Name | Define |
Related Guide Page | https://guide.denizenscript.com/guides/basics/definitions.html |
Syntax | define [<id>](:<action>)[:<value>] |
Short Description | Creates a temporary variable inside a script queue. |
Full Description | Definitions are queue-level 'variables' that can be used throughout a script, once defined, by using the <[<id>]> tag.
Definitions are only valid on the current queue and are not transferred to any new queues constructed within the script, such as by a 'run' command, without explicitly specifying to do so. Definitions are lighter and faster than creating a temporary flag. Definitions are also automatically removed when the queue is completed, so there is no worry for leaving unused data hanging around. This command supports data actions, see data actions. Definitions can be sub-mapped with the '.' character, meaning a def named 'x.y.z' is actually a def 'x' as a MapTag with key 'y' as a MapTag with key 'z' as the final defined value. In other words, "<[a.b.c]>" is equivalent to "<[a].get[b].get[c]>" |
Related Tags | <[<id>]> to get the value assigned to an ID
<QueueTag.definition[<definition>]> Returns the value of the specified definition. (...)
<QueueTag.definitions> Returns the names of all definitions that were added to the current queue.
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Synonyms (Search Aid) | definition |
Group | queue |
Source | https://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/DefineCommand.java#L27 |