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...
NameExecute
Syntaxexecute [as_player/as_op/as_npc/as_server] [<Bukkit-command>] (silent)
Short DescriptionExecutes an arbitrary server command as if the player, NPC, or server typed it in.
Full DescriptionAllows the execution of server commands through a Denizen script.
Commands can be executed as the server, as an npc, as an opped player, or as a player, as though it was typed by the respective source.

Note that you should generally avoid using 'as_op', which is only meant for very specific special cases. 'as_server' is usually a better option.

Note: do not include the slash at the start. A slash at the start will be interpreted equivalent to typing two slashes at the front in-game.

Note that this is a Denizen script command that executes Bukkit commands.
This can be considered the inverse of '/ex' (a Bukkit command that executes Denizen script commands).

The 'silent' option can be specified with 'as_server' to hide the output. Note that 'silent' might or might not work with different plugins depending on how they operate.
It can also be used with 'as_player' or 'as_op' to use network interception to silence the command output to player chat.

Generally, you should never use this to execute a vanilla command, there is almost always a script command that should be used instead.
Usually the 'execute' command should be reserved for interacting with external plugins.
Related Tags<entry[saveName].output> returns the output to an as_server sender.
Usage Example
# Use to execute the save-all command as the server.
- execute as_server "save-all"
Usage Example
# Use to make the linked (non-op) player execute a command that normally only ops can use. Generally avoid ever doing this.
- execute as_op "staffsay hi"
Groupserver
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/ExecuteCommand.java#L36