SyntaxΒΆ

A table of the syntax for different operations.

Syntax

Operation

:var varName .= <int>

Define a new variable

:obj objectiveName <objective>

Define a new scoreboard objective

:sobj objectiveName <objective> <target> <assignment operator> <int>

Set the value of an objective for a given target (eg. @a or PlayerName)

:def defName <text replacement>

Define a text replacement for the preprocessor. See examples for more information

:var varName <assignment operator> <int>

Update the value of an existing variable

:tvar varName

Used to test variables in if commands (eg. execute if :tvar varName matches 1)

:func name

Define a function. Generates a new mcfunction file

:endfunc

Close a function definition.

:call <function>

Call a function. Can infer namespace based on directory (see function calling example)

:while <condition>

Create a while loop. Condition should be something passable to an if command.

:endwhile

Close a while loop.

Assignment Operators

+=

Add to a variable.

-=

Subtract from a variable.

=

Set the value of a variable.