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...
NameRandom
Syntaxrandom [<commands>]
Short DescriptionSelects a random choice from the following script commands.
Full DescriptionThe random command picks one of the following script command and skips all the other script commands that are in its section.
Commands like "repeat 1" or "if true" can be used to group together a sublisting of commands to execute together
(as a way to get around the 1-command limit).

If wanting to choose a random long set of commands,
consider instead using Command:choose with Tag:util.random.int.to
Related Tags<entry[saveName].possibilities> returns an ElementTag of the possibility count.
<entry[saveName].selected> returns an ElementTag of the selected number.
Usage Example
# Use to choose randomly from a braced set of commands
- random:
  - narrate "hi"
  - narrate "hello"
  - narrate "hey"
Usage Example
# Use to perform multiple commands randomly
- random:
  - repeat 1:
    - narrate "Hello"
    - narrate "How are you?"
  - repeat 1:
    - narrate "Hey"
    - narrate "It is a nice day."
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/RandomCommand.java#L24