Skip to content

Iterative Parameters

Relaxing9 edited this page Jun 27, 2022 · 1 revision

ITER

Iterate over things

ParameterDescriptionValid valuesDefault valueRequired
whatWhat to iterate overONLINE_PLAYERStrue
permA permission to filter players if what == ONLINE_PLAYERSAny permissiontrue
actionsSub actions which can use the result of this operationAn array/list of actionstrue
ONLINE_PLAYERS

When iterating over online players, the following variables are defined:

VariableDescription
iter_locXThe x-coordinate of the player
iter_locYThe y-coordinate of the player
iter_locZThe z-coordinate of the player
iter_nameThe name of the player
iter_displaynameThe display name of the player
iter_uuidThe UUID of the player
iter_healthThe health of the player
iter_levelThe XP level of the player
iter_foodThe food level of the player

REPEAT

The repeat action starts a timer that will repeatedly call its sub-actions until the iteration variable has reached its end. This is similar to what a for loop does in Java, where iterative variable is i:

for (inti = start; increment > 0 ? i <= to : i >= to; i += increment)
actions();

Available parameters are:

ParameterDescriptionValid valuesDefault valueRequired
periodThe delay between two iterations in ticksInteger, >= 120false
delayThe delay before the first execution of the sub-actionsInteger, >= 020false
fromThe iteration start variable, inclusiveInteger0false
toThe iteration end variable, inclusiveInteger9false
incrementThe amount that the loop variable will be incremented with each iterationInteger1false
counterVarThe variable through which the loop counter will be made available to sub-actionsVariable nameifalse
actionsSub actions which will be executed with each loop cycleAn array/list of actionstrue

The loop counter is available through the variable named by counterVar.

WAIT

Wait executes a set of tasks with a certain delay.

ParameterDescriptionValid valuesDefault valueRequired
durationThe delay before the execution of the sub-actions, in ticksInteger, >= 020false
actionsSub actions which will be executed after the delayAn array/list of actionstrue

Clone this wiki locally