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 183 commands...
NameClickable
Syntaxclickable (<script>/cancel:<id>) (def:<element>|.../defmap:<map>/def.<name>:<value>) (usages:<#>) (for:<player>|...) (until:<duration>)
Short DescriptionGenerates a clickable command for players.
Full DescriptionGenerates a clickable command for players.

Generally, prefer to write a command script and simply "on_click[/yourcommandhere]" rather than using generated clickables.
Generated clickables are a utility intended to enable clickables that are restricted from being normally accessed without receiving a clickable message.

Specify a task script to run, or put an executable script section as sub-commands.

When running a task, optionally any definitions to pass.

When using a sub-section, the running commands will be in their own queue, but copy out the original queue's definitions and context source.

Optionally specify a maximum number of usages (defaults to unlimited).

Optionally specify a maximum duration it can be used for with 'until'.

If no duration is specified, the clickable will remain valid until the server stops or restarts.
WARNING: if you use clickables very often without a duration limit, this can lead to a memory leak.
Clickables that have a specified max duration will occasionally be cleaned from memory.

Optionally specify what players are allowed to use it. Defaults to unrestricted (any player that sees the click message may use it).
Note that it is possible for a player to find the generated command ID in their logs and send it to another player to "/" execute, so if you don't restrict player access it may be abused in that way.

This internally generates a command of the form "/denizenclickable <generated_id>".

Players will need the permission "denizen.clickable" to be able to use this.

You can cancel a clickable at any time via "cancel:<id>", where ID is the generated ID from saving the initial generated command.
Related Tags<entry[saveName].command> returns the command to use in "on_click".
<entry[saveName].id> returns the generate command's ID.
<ElementTag.on_click[<command>]> Adds a click command to the element, which makes the element execute the input command when clicked. (...)
Usage Example
#Use to generate a clickable that just narrates "hello there!" when clicked.
- clickable save:my_clickable:
    - narrate "Hello there!"
- narrate "Click <blue><element[here].on_click[<entry[my_clickable].command>]><reset>!"
Usage Example
#Use to generate a clickable message that will run a task script named 'test_script'.
- clickable test_script save:my_clickable
- narrate "Click <blue><element[here].on_click[<entry[my_clickable].command>]><reset>!"
Usage Example
#Use to generate a clickable message that will run a task script named 'reward_drop', that can be used by only the first person to click it.
- clickable reward_drop usages:1 save:reward
- announce "<blue><bold><element[Reward Here].on_click[<entry[reward].command>]><reset>!"
Usage Example
#Use to generate a clickable message exclusively for the linked player, that must be used within a minute.
- clickable your_secret def:quest3 for:<player> until:1m save:secretmessage
- narrate "Do you want to know the secret? <blue><element[Yes].on_click[<entry[secretmessage].command>]><reset> / No."
Usage Example
#Use to generate a clickable message and cancel it manually later.
- clickable test_script save:my_clickable save:myclickable
- narrate "Click <blue><element[here].on_click[<entry[my_clickable].command>]><reset> before you land!"
- waituntil rate:1s max:30s <player.is_on_ground>
- clickable cancel:<entry[myclickable].id>
Groupplayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ClickableCommand.java#L38