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...
NameCustomEvent
Syntaxcustomevent [id:<id>] (context:<map>)
Short DescriptionFires a custom world script event.
Full DescriptionFires a custom world script event.

Input is an ID (the name of your custom event, choose a constant name to use), and an optional MapTag of context data.

Linked data (player, npc, ...) is automatically sent across to the event.

Use with Event:custom event
Related Tags<entry[saveName].any_ran> returns a boolean indicating whether any events ran as a result of this command.
<entry[saveName].was_cancelled> returns a boolean indicating whether the event was cancelled.
<entry[saveName].determination_list> returns a ListTag of determinations to this event. Will be an empty list if 'determine output:' is never used.
Usage Example
# Use to call a custom event with path "on custom event id:things_happened:"
- customevent id:things_happened
Usage Example
# Use to call a custom event with path "on custom event id:things_happened:" and supply a context map of basic data.
- customevent id:things_happened context:[a=1;b=2;c=3]
Usage Example
# Use to call a custom event with a path such as "on custom event id:things_happened data:item:stone:" and supply a context map of more interesting data.
- definemap context:
    waffle: hello world
    item: <player.item_in_hand>
- customevent id:things_happened context:<[context]>
Usage Example
# Use to call a custom event and allow cancelling or replacing a value.
- definemap context:
    message: hello world
- customevent id:custom_message context:<[context]> save:event
- if <entry[event].was_cancelled>:
    - stop
- define message <entry[event].determination_list.first.if_null[<[context.message]>]>
- narrate "Final message is: <[message]>"
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/CustomEventCommand.java#L23