MCFunction - DauntlessStudio/Bedrock-Developments GitHub Wiki

Class: MCFunction

Remarks

A class for working with .mcfunction files.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new MCFunction(filepattern): MCFunction

Parameters

Name Type Description
filepattern string The filepattern used to find or create mcfunction files.

Returns

MCFunction

Remarks

Creates a list of files from the filepattern. Note that if no files match the filepattern, a new file will be created in BP/functions using the filepattern as a path.

Defined in

ts/app/types/minecraft.ts:208

Properties

files

files: File[]

Remarks

The mcfunction files handled by this class instance, as an array of Files.

Defined in

ts/app/types/minecraft.ts:202

Methods

addCommand

addCommand(commands, options?): void

Parameters

Name Type Description
commands string[] A list of commands to add to the files.
options? Object The mcfunction's comments at the top of the file, note these are only added if the file is empty.
options.description string -
options.selector? string -
options.source? string -

Returns

void

Remarks

Adds commands and optional comments.

Defined in

ts/app/types/minecraft.ts:222

⚠️ **GitHub.com Fallback** ⚠️