Conditionals

ComparatorDefinition

<

Less than

>

Greater than

<=

Less or equal than

>=

Greater or equal than

==

Equals

!=

Not equals

||

OR

&&

AND

=~

Match

=@

Like

[IF]

Indicates a comparison between two values

Example:

- "[IF] %player_world% != world_nether" # Everything inside this IF will only be executed if the player is NOT in the world_nether world
- "[MESSAGE] &aYou are not in world_nether!"

[ELSE IF]

If the primary comparison ([IF]) is not met, this condition will be checked

Example:

- "[ELSE IF] %player_world% == world_nether" # Everything inside this IF will only be executed if the player is IN the world_nether world
- "[MESSAGE] &aYou are in world_nether!"

[ELSE]

If none of the conditions are met ([IF and [ELSE IF] if present), the actions inside the [ELSE] will be executed

Example:

- "[ELSE]"
- "[MESSAGE] Else actions"

[FI]

(FI is IF in reverse) Indicates that the condition ends here and thereafter, the actions belong to another conditional or to none. It is not necessary to use this action in commands where there is only one conditional, but it is necessary if there is more than one IF.

Example:

- "[FI]"
- "[MESSAGE] Actions without conditional"

[RETURN]

Cancels the execution of the following code, can be used inside [IF], for example to compare permissions.

Example:

- "[IF] %player_is_op% == no"
- "[RETURN]"
- "[FI]"
- "[MESSAGE] You are OP!"

Full example

- "[IF] %player_is_op% == yes"
- "[MESSAGE] &aYou are OP!"
- "[ELSE IF] %player_has_permission_tchat.admin% != false"
- "[MESSAGE] &2You have permissions!"
- "[ELSE]"
- "[MESSAGE] &cYou don't have permissions to use this command!"
- "[FI]"
- "[IF] %player_online% == false"
- "[RETURN]"
- "[FI]"
- "[IF] %player_ping% <= 100"
- "[MESSAGE] Your ping is &agood"
- "[ELSE]"
- "[MESSAGE] Your ping is &cbad"

Last updated