Denizen Script Commands


Commands are always written with a '-' before them, and are the core component of any script, the primary way to cause things to happen.
Learn about how commands work in The Beginner's Guide.


Showing 1 out of 184 commands...
NameRepeat
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/loops.html
Syntaxrepeat [stop/next/<amount>] (from:<#>) (as:<name>) [<commands>]
Short DescriptionRuns a series of braced commands several times.
Full DescriptionLoops through a series of braced commands a specified number of times.
To get the number of loops so far, you can use <[value]>.

Optionally, specify "as:<name>" to change the definition name to something other than "value".

Optionally, to specify a starting index, use "from:<#>". Note that the "amount" input is how many loops will happen, not an end index.
The default "from" index is "1". Note that the value you give to "from" will be the value of the first loop.

To stop a repeat loop, do - repeat stop

To jump immediately to the next number in the loop, do - repeat next
Related Tags<[value]> to get the number of loops so far
Usage Example
# Use to loop through a command five times.
- repeat 5:
    - announce "Announce Number <[value]>"
Usage Example
# Use to announce the numbers: 1, 2, 3, 4, 5.
- repeat 5 as:number:
    - announce "I can count! <[number]>"
Usage Example
# Use to announce the numbers: 21, 22, 23, 24, 25.
- repeat 5 from:21:
    - announce "Announce Number <[value]>"
Synonyms (Search Aid)for
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/RepeatCommand.java#L28