Syntax¶

Syntax

Notes

var varName := <int>

Define a new variable

obj <objective_name> <objective>

Define a new scoreboard objective

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

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

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

!def macro($arg1, $arg2)

Define a macro. See the macros page for more information

?macro("arg1", "arg2")

Calls a macro. See the macros page for more information

!end

Ends a macro definition. See the macros page for more information

call <function>

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

runif <condition>

Starts an if statement

else

Runs if an if statement’s condition was not true

while <condition>

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

end

Close a function, while loop, or if statement

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

%

Used to escape keywords (eg. say %call a function -> say call a function)

Assignment Operators

+=

Add to a variable

-=

Subtract from a variable

=

Set the value of a variable