SyntaxΒΆ

Syntax

Notes

:var varName .= <int>

Define a new variable

:obj objectiveName <objective>

Define a new scoreboard objective

:sobj objectiveName <target> <objective> <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.

:sbop

Shorthand for scoreboard players operation

:gvar varName

Can be used with a scoreboard operation as such: :sbop :gvar var1 += :gvar var2

:delvar varName OR :delobj objName

Delete a variable or objective. Can be used interchangeably

Assignment Operators

+=

Add to a variable.

-=

Subtract from a variable.

=

Set the value of a variable.