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 all 43 commands...

Categories:

core | file | GUI System | image | interface | networking | queue | world



Category: core


NameAdjust
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/mechanisms.html
Syntaxadjust [<ObjectTag>/def:<name>|...] [<mechanism>](:<value>)
Short DescriptionAdjusts an object's mechanism.
Full DescriptionMany object tag types contains options and properties that need to be adjusted.
Denizen employs a mechanism interface to deal with those adjustments.
To easily accomplish this, use this command with a valid object mechanism, and sometimes accompanying value.

Specify "def:<name>" as an input to adjust a definition and automatically save the result back to the definition.

You can optionally adjust a MapTag of mechanisms to values.

To adjust an item in an inventory, use Command:inventory, as '- inventory adjust slot:<#> <mechanism>:<value>'.
Note that that is only for items, not actual inventories.
To adjust an actual InventoryTag mechanism, you should still use the normal 'adjust' command, not 'inventory adjust'.
Related Tags<entry[saveName].result> returns the adjusted object.
<entry[saveName].result_list> returns a ListTag of adjusted objects.
Usage Example
# Use to set a custom display name on an entity.
- adjust <[some_entity]> custom_name:ANGRY!
Usage Example
# Use to set the skin of every online player.
- adjust <server.online_players> skin:Notch
Usage Example
# Use to modify an item held in a definition.
- adjust def:stick "display_name:Fancy stick"
Synonyms (Search Aid)mechanism
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/AdjustCommand.java#L31

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

NameDebug
Related Guide Pagehttps://guide.denizenscript.com/guides/first-steps/problem-solving.html
Syntaxdebug [<type>] [<message>] (name:<name>)
Short DescriptionShows a debug message.
Full DescriptionUse to quickly output debug information to console.

Valid types include:
DEBUG: standard hideable debug.
HEADER: standard hideable debug inside a header line.
FOOTER: a footer line.
SPACER: a spacer line.
LOG: global output, non-hideable.
APPROVAL: "Okay!" output, non-hideable.
ERROR: "Error!" output, non-hideable.
REPORT: normally used to describe the arguments of a command, requires a name, hideable.
EXCEPTION: outputs a full java stacktrace.
RECORD: Use message 'start' to start recording, 'submit' to submit a recording, or 'cancel' to cancel a recording.

TODO: Should [<type>] be required? Perhaps default to 'debug' mode?
Related Tags<entry[saveName].submitted> returns the submit link (if any).
Usage Example
# Use to show an error.
- debug error "Something went wrong!"
Usage Example
# Use to add some information to help your own ability to read debug output from you script.
- debug debug "Time is currently <[milliseconds].div[1000].round> seconds!"
Usage Example
# Use to record a debug log of a certain script.
# NOTICE: Spamming debug recordings to the official Denizen Paste instance will result in you being blocked from the paste service.
- debug record start
- run myscript
- ~debug record submit save:mylog
- narrate "Recorded log as <entry[mylog].submitted||<red>FAILED>"
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/DebugCommand.java#L23

NameFlag
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/flags.html
Syntaxflag [<object>|...] [<name>([<#>])](:<action>)[:<value>] (expire:<time>)
Short DescriptionSets or modifies a flag on any flaggable object.
Full DescriptionThe flag command sets or modifies custom data values stored on any flaggable object (the server, a player/NPC/entity, a block location, ...).
See also Language:flag system.

This command supports data actions, see Language:data actions.

Flags by default are added permanently (or for the lifetime of the object they're attached to).
You can optionally specify a system time the flag will expire at, using either a DurationTag or a TimeTag.
If a DurationTag is used, it will be equivalent to: <util.time_now.add[<your_duration_here>]>
Related Tags<FlaggableObject.flag[<flag_name>]> Returns the specified flag from the flaggable object. (...)
<FlaggableObject.has_flag[<flag_name>]> Returns true if the flaggable object has the specified flag, otherwise returns false. (...)
<FlaggableObject.flag_expiration[<flag_name>]> Returns a TimeTag indicating when the specified flag will expire. (...)
<FlaggableObject.list_flags> Returns a list of the flaggable object's flags. (...)
<server.online_players_flagged[<flag_name>]> ERROR: TAG INVALID
<server.players_flagged[<flag_name>]> ERROR: TAG INVALID
<server.spawned_npcs_flagged[<flag_name>]> ERROR: TAG INVALID
<server.npcs_flagged[<flag_name>]> ERROR: TAG INVALID
Usage Example
# Use to create or set a flag on a player.
- flag <player> playstyle:aggressive
Usage Example
# Use to set a temporary flag for five minutes on a player.
- flag <player> just_did_something expire:5m
Usage Example
# Use to flag an npc with a given tag value.
- flag <npc> location:<npc.location>
Usage Example
# Use to apply mathematical changes to a flag's value on a unique object.
- flag <context.damager> damage_dealt:+:<context.damage>
Usage Example
# Use to add an item to a server flag as a new value without removing existing values.
- flag server cool_people:->:<[player]>
Usage Example
# Use to add multiple items as individual new values to a server flag that is already a list.
- flag server cool_people:|:<[player]>|<[someplayer]>
Usage Example
# Use to remove an entry from a server flag.
- flag server cool_people:<-:<[someplayer]>
Usage Example
# Use to completely remove a flag.
- flag server cool_people:!
Usage Example
# Use to modify a specific index in a list flag.
- flag server myflag[3]:HelloWorld
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/FlagCommand.java#L88

NameMongo
Syntaxmongo [id:<ID>] [connect:<uri> database:<database> collection:<collection>/disconnect/command:<map>/find:<map> (by_id:<id>)/insert:<map>/update:<update> new:<new> (upsert:true/{false})/use_database:<database>/use_collection:<collection>]
Short DescriptionInteracts with a MongoDB server.
Full DescriptionThis command is used to interact with a MongoDB server.

MongoDB is a NoSQL database which uses concepts such as Documents and Collections to store data. MongoDB uses a form of JSON to represent its data.
It can interact with localhost connections as well as hosted connections (such as MongoDB's Atlas) via a connection URI.
Store your connection URI in the Denizen secrets file at 'plugins/Denizen/secrets.secret'. Refer to ObjectType:SecretTag for usage info.

Mongo works as a document-oriented database, where data is stored in Documents. Documents are stored inside Collections. Collections can contain many Documents. Collections are then stored inside Databases.

Usage of the mongo command should almost always be used as ~waitable (see Language:~waitable), as large queries and insertions can take a while to retrieve or send.

You can open a mongo connection with connect:<uri>. You must specify a database and collection to connect to with the database:<database> and collection:<collection> options.
You can change the database or collection you are connected to with use_database:<database> and use_collection:<collection>
If a Database or Collection you connect to does not exist, once you insert some data then the Database or Collection will be created automatically.

To insert Documents, use insert:<map>.
To find a specific document from fragments of data, use find:<map>. You can include MongoDB's special query filters to further refine your query. If you want to search by a Document's ID, use by_id:id.

To update a Document's data, use update:<update> with the old data, and new:<new> for the new data being updated. This will update every Document matched with the provided data.
You can also include the upsert flag, to create a new Document if the Document you are trying to update does not already exist.

As MongoDB offers a variety of commands, to run a command not wrapped here you can use command:<map>.

TODO: When opening a connection, Mongo will output a lot of data to the console. There currently is not a way to turn this off.

The mongo command is merely a wrapper, and further usage details should be gathered from an official MongoDB command reference rather than from Denizen command help.
You can view the official mongo documentation here: 🔗https://www.mongodb.com/docs/manual/introduction/.
You can view a list of commands that MongoDB supports here: 🔗https://www.mongodb.com/docs/manual/reference/command/.
Related Tags<util.mongo_connections> returns a ListTag of all the current Mongo connections.
<entry[saveName].result> returns the text result sent back from Mongo in a JSON format. JSON can be in an ElementTag or a ListTag depending on the action run.
<entry[saveName].inserted_id> returns the ID of the item that has been inserted via the `insert` action.
<entry[saveName].ok> returns the 'ok' value from the result. Used with the `command` action.
<entry[saveName].upserted_id> returns the ID the upserted item. Returned if the `upsert` bool is true when updating.
<entry[saveName].updated_count> returns the amount of Documents updated via the `update` action.
Usage Example
# Use to connect to a Mongo instance.
- ~mongo id:name connect:<secret[uri]>
Usage Example
# Use to disconnect from a Mongo instance.
- mongo id:name disconnect
Usage Example
# Run a simple command.
- ~mongo id:name command:[dbStats=1]
Usage Example
# Run more complex commands.
- definemap commands:
     count: my_collection
     skip: 4
 - ~mongo id:name command:<[commands]>
Usage Example
# Simple find query.
- ~mongo id:name find:[name=Bob]
Usage Example
# Complex find query with query filters.
- definemap filters:
     $and:
         - number_greater_than:
             $gt: 2
         - number_less_than:
             $lt: 5
- ~mongo id:name find:<[filters]>
Usage Example
# Insert data into a Collection.
- definemap data:
     name: Pluto
     order_from_sun: 9
     has_rings: false
     main_atmosphere:
         - N2
         - CH4
         - CO
- ~mongo id:name insert:<[data]> save:mg
Usage Example
# Update data.
- definemap old_data:
     name: Pluto
- definemap new_data:
     $set:
         name: Pluto (A Dwarf Planet)
- ~mongo id:name update:<[old_data]> new:<[new_data]>
Usage Example
# Change Databases.
- ~mongo id:name use_database:my_new_database
Usage Example
# Change Collections.
- ~mongo id:name use_collection:my_new_collection
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/MongoCommand.java#L36

NameNote
Related Guide Pagehttps://guide.denizenscript.com/guides/advanced/notables.html
Syntaxnote [<object>/remove] [as:<name>]
Short DescriptionAdds or removes a named note of an object to the server.
Full DescriptionAdd or remove a 'note' to the server, persistently naming an object that can be referenced in events or scripts.
Only works for object types that are 'notable'.
Noted objects are "permanent" versions of other ObjectTags. (See: Language:ObjectTags)
Noted objects keep their properties when added.

Notable object types: CuboidTag, EllipsoidTag, PolygonTag, LocationTag, InventoryTag
Related Tags<server.notes[<type>]> ERROR: TAG INVALID
<CuboidTag.note_name> ERROR: TAG INVALID
<EllipsoidTag.note_name> ERROR: TAG INVALID
<PolygonTag.note_name> ERROR: TAG INVALID
<InventoryTag.note_name> ERROR: TAG INVALID
<LocationTag.note_name> ERROR: TAG INVALID
Usage Example
# Use to note a cuboid.
- note <[some_cuboid]> as:mycuboid
Usage Example
# Use to remove a noted cuboid.
- note remove as:mycuboid
Usage Example
# Use to note a location.
- note <context.location> as:mylocation
Synonyms (Search Aid)notable
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/NoteCommand.java#L26

NameRedis
Syntaxredis [id:<ID>] [connect:<host> (auth:<secret>) (port:<port>/{6379}) (ssl:true/{false})/disconnect/subscribe:<channel>|.../unsubscribe/publish:<channel> message:<message>/command:<command> (args:<arg>|...)]
Short DescriptionInteracts with a Redis server.
Full DescriptionThis command is used to interact with a redis server. It can run any standard redis commands as well as subscribe for pub/sub redis channel notifications.

Redis is a simple key/value data store that is typically used for caching and sending data between servers.
The redis server runs in memory, meaning requests are insanely fast. If you run redis locally, you can expect responses to take under a millisecond.
It is normally advised to run commands as ~waitable (see Language:~waitable), but because of the usual fast responses when the server is on localhost, you can also run commands without ~waiting.

When running commands, make sure to escape unpredictable values such as player input.
Alternatively, include the main redis command as the 'command' input and further arguments as a ListTag input for 'args'.

This command supports subscribing to pub/sub redis channels. This allows you to listen to published messages to redis from any source, including other servers.
When you subscribe to a channel, matching messages sent to the channel will trigger the Event:redis pubsub message event.
Connections that are subscribed to channels get tied up listening for messages and are unavailable to run redis commands.
The channels you subscribe to support wildcard (*) matchers and other patterns, defined by the redis docs: 🔗https://redis.io/commands/psubscribe

Note: Make sure there are at least a few ticks between opening a subscription and closing it, otherwise strange behavior will occur.

You can publish messages to listening subscribers via publish:<channel> message:<message>.
Note that this has to be done on a separate redis connection if it is already subscribed.
Saving the result of this call returns the number of connected subscribers the message was sent to.

The redis command is merely a wrapper, and further usage details should be gathered from an official redis command reference rather than from Denizen command help.
You can view the official redis documentation and the supported commands here: 🔗https://redis.io/
Related Tags<entry[saveName].result> returns an ElementTag or ListTag of the results of your command, depending on the redis command you ran.
<util.redis_connections> Returns a list of all Redis connections opened by Command:redis.
Usage Example
# Use to connect to a Redis server.
- ~redis id:name connect:localhost
Usage Example
# Use to connect to a Redis server with a secret auth key.
- ~redis id:name connect:localhost auth:<secret[my_redis_secret]>
Usage Example
# Use to connect to a Redis server over ssl.
- ~redis id:name connect:localhost port:6380 ssl:true
Usage Example
# Set a key/value pair in the Redis server.
- ~redis id:name "command:set my_key my_value"
Usage Example
# Delete the "foo" key.
- ~redis id:name "command:del my_key"
Usage Example
# Set a key that auto-expires in 60 seconds.
- ~redis id:name "command:setex my_key 60 'value with spaces'"
Usage Example
# Run a command with unpredictable input.
- ~redis id:name command:set args:<list[my_key].include_single[<context.message>]>
Usage Example
# Get a key's value.
- ~redis id:name "command:get my_key" save:result
Usage Example
# Get a key's value in the background via a waitable.
- ~redis id:name "command:get my_key" save:result
Usage Example
# Append values to the front or back of a redis list.
- ~redis id:name "command:rpush my_list a"
- ~redis id:name "command:rpush my_list b"
- ~redis id:name "command:lpush my_list c"
Usage Example
# Retrieve a ListTag of the members stored in a redis list (0 is the start of the list, -1 is the end).
- ~redis id:name "command:lrange my_list 0 -1"
Usage Example
# Subscribe to a redis channel. This will match published messages to channel_1, channel_foo, etc.
- ~redis id:name subscribe:channel_*
Usage Example
# Subscribe to multiple redis channels. Supports wildcards for any list entry.
- ~redis id:name subscribe:a|b*|c|d
Usage Example
# Publish a message to a redis channel. This will trigger the <@link event redis pubsub message> event for any subscribed connections for any server.
- ~redis id:name publish:channel_1 "message:hey look something happened"
Usage Example
# Unsubscribe from a redis channel. Leaves the connection intact.
- redis id:name unsubscribe
Usage Example
# Disconnect from redis.
- redis id:name disconnect
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/RedisCommand.java#L25

NameReflectionSet
Syntaxreflectionset [object:<object>] [field:<name>] (value:<value>)
Short DescriptionSets a field on an object to a given value, or null.
Full DescriptionGive a ObjectType:JavaReflectedObjectTag as the object, a field name, and a value (or leave off for null) to set the value of a field on that object.

Uses reflection to set, and so can bypass 'private' or 'final' field limits if permitted by config.

If the value is fed as a general ObjectTag, automatic conversion will be attempted.
If automatic conversion is not possible, you must pass a ObjectType:JavaReflectedObjectTag with the appropriate type as the value.

Requires config setting "Reflection.Allow set command".
Related Tags<ObjectTag.reflected_internal_object> Returns the reflected internal Java object for a given ObjectTag.
Usage Example
# Use to change Bukkit's reference to a world's environment to the_end.
- narrate <world[world].environment>
- define obj <world[world].reflected_internal_object>
- narrate <[obj].reflect_field[environment].interpret>
- reflectionset object:<[obj]> field:environment value:the_end
- narrate <world[world].environment>
- narrate <[obj].reflect_field[environment].interpret>
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/ReflectionSetCommand.java#L30

NameReload
Syntaxreload ({scripts}/scripts_now/config/saves/notes)
Short DescriptionReloads all Denizen scripts. Primarily for use as an in-game command.
Full DescriptionReloads all Denizen scripts.
Primarily for use as an in-game command, like "/ex reload".

By default, reloads scripts in a way that may delay a few ticks to avoid interrupting the server on large reloads.

Optionally, specify "scripts_now" to force a locked reload (server freezes until reloaded).

You can specify "config", "saves", or "notes" to reload that data instead of scripts.

When using 'scripts' (default), the reload command is ~waitable. Refer to Language:~waitable.
Related TagsNone
Usage Example
# Use to reload scripts automatically
- reload
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/ReloadCommand.java#L25

NameSQL
Syntaxsql [id:<ID>] [disconnect/connect:<server> (username:<username>) (password:<secret>) (ssl:true/{false})/query:<query>/update:<update>]
Short DescriptionInteracts with a MySQL server.
Full DescriptionThis command is used to interact with a MySQL server. It can update the database or query it for information.

This commands exists primarily for interoperability with pre-existing databases and external services.
It should never be used for storing data that only Denizen needs to use. Consider instead using Command:flag.

The general usage order is connect -> update/query -> disconnect.
It is not required that you disconnect right after using, and in fact encouraged that you keep a connection open where possible.

When connecting, the server format is IP:Port/Database, EG 'localhost:3306/test'.
You can also append options to the end, like 'localhost:3306/test?autoReconnect=true'
Store your password in the Denizen secrets file at 'plugins/Denizen/secrets.secret'. Refer to ObjectType:SecretTag for usage info.

You can switch whether SSL is used for the connection (defaults to false).

Note that when using tag, it is recommended you escape unusual inputs to avoid SQL injection.

The SQL command is merely a wrapper for SQL queries, and further usage details should be gathered from an official MySQL query reference rather than from Denizen command help.

SQL connections are not instant - they can take several seconds, or just never connect at all.
It is recommended you hold the command by doing "- ~sql ..." rather than just "- sql ..."
as this will delay the commands following the SQL command until after the SQL operation is complete.

If you have an SQL database server other than MySQL, be sure to include the driver prefix (defaults to "mysql://" when unspecified).
Related Tags<entry[saveName].result_list> returns a ListTag of all row ListTags from a query or update command. That's a ListTag of ListTags, so for example to get the second entry of the first row you'd use "result_list.get[1].get[2]"
<entry[saveName].affected_rows> returns how many rows were affected by an update command.
<util.sql_connections> Returns a list of all SQL connections opened by Command:sql.
Usage Example
# Use to connect to an SQL server.
- ~sql id:name connect:localhost:3306/test username:space password:<secret[sql_pw]>
Usage Example
# Use to connect to an SQL server over an SSL connection.
- ~sql id:name connect:localhost:3306/test username:space password:<secret[sql_pw]> ssl:true
Usage Example
# Use to connect to an SQL server with a UTF8 text encoding.
- ~sql id:name connect:localhost:3306/test?characterEncoding=utf8 username:space password:<secret[sql_pw]>
Usage Example
# Use to update an SQL server.
- ~sql id:name "update:CREATE table things(id int,column_name1 varchar(255),column_name2 varchar(255));"
Usage Example
# Use to update an SQL server.
- ~sql id:name "update:INSERT INTO things VALUES (3, 'hello', 'space');"
Usage Example
# Use to query an SQL server.
- ~sql id:name "query:SELECT id,column_name1,column_name2 FROM things;" save:saveName
- narrate <entry[saveName].result_list>
Usage Example
# Use to query an SQL server.
- ~sql id:name "query:SELECT id,column_name1,column_name2 FROM things WHERE id=3;" save:saveName2
- narrate <entry[saveName2].result_list>
Usage Example
# Use to disconnect from an SQL server.
- sql disconnect id:name
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/SQLCommand.java#L34

NameWebget
Syntaxwebget [<url>] (data:<data>) (method:<method>) (headers:<map>) (timeout:<duration>/{10s}) (savefile:<path>) (hide_failure)
Short DescriptionGets the contents of a web page or API response.
Full DescriptionConnects to a webpage or API and downloads its contents, to be used via the save argument and corresponding entry tags.

This should almost always be ~waited for. Refer to Language:~waitable.

Note that while this will replace URL spaces to %20, you are responsible for any other necessary URL encoding.
You may want to use the Tag:ElementTag.url_encode tag for this.

Optionally, use "data:<data>" to specify a set of data to send to the server (changes the default method from GET to POST).
A BinaryTag input will be used directly - any other input will be treated as a String and encoded as UTF-8.

Optionally, use "method:<method>" to specify the HTTP method to use in your request.
Can be: GET, POST, HEAD, OPTIONS, PUT, DELETE, TRACE, PATCH.

Optionally, use "headers:" to specify a MapTag of headers.

Optionally, use "savefile:" to specify a path to save the retrieved file to.
This will remove the 'result' entry savedata.
Path is relative to server base directory.

Optionally, specify the "timeout:" to set how long the command should wait for a webpage to load before giving up. Defaults to 10 seconds.

Optionally, specify 'hide_failure' to indicate that connection errors are acceptable and shouldn't display in logs.

This command accepts secret inputs via ObjectType:SecretTag as the URL or as the value of any header.
Note that you cannot mix secret with non-secret - meaning, "webget <secret[my_secret]>" and "webget https://example.com" are both valid, but "webget https://example.com/<secret[my_secret]>" is not.
Similarly, for headers, each individual header value can either be a secret or not a secret.
Related Tags<entry[saveName].failed> returns whether the webget failed. A failure occurs when the status is not 2XX/3XX or webget failed to connect.
<entry[saveName].result> returns the text of the result of the webget. This is null only if webget failed to connect to the url.
<entry[saveName].result_binary> returns the raw binary data of the result of the webget. This is null only if webget failed to connect to the url.
<entry[saveName].result_headers> returns a MapTag of the headers returned from the webserver. Every value in the result is a list.
<entry[saveName].status> returns the HTTP status code of the webget. This is null only if webget failed to connect to the url.
<entry[saveName].time_ran> returns a DurationTag indicating how long the web connection processing took.
<ElementTag.url_encode> Encodes the element using URL encoding.
Usage Example
# Use to download the google home page.
- ~webget https://google.com save:google
- narrate <entry[google].result>
Usage Example
# Use to save a webpage to your server's base directory
- ~webget https://google.com savefile:google.html
Usage Example
# Use to post data to a server.
- ~webget https://api.mojang.com/orders/statistics 'data:{"metricKeys":["item_sold_minecraft"]}' headers:<map.with[Content-Type].as[application/json]> save:request
- narrate <entry[request].result>
Usage Example
# Use to retrieve and load an API response into yaml.
- ~webget https://api.mojang.com/users/profiles/minecraft/<player.name> save:request
- yaml loadtext:<entry[request].result> id:player_data
Synonyms (Search Aid)wget
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/WebGetCommand.java#L39

NameWebServer
Syntaxwebserver [start/stop] (port:<#>) (ignore_errors)
Short DescriptionCreates a local HTTP web-server within your minecraft server.
Full DescriptionCreates a local HTTP web-server within your minecraft server.

The server does not provide SSL (HTTPS) security or functionality.
The server does not provide active abuse-prevention or routing control or etc.

If your webserver is meant for public connection, it is very strongly recommended you put the webserver behind a reverse-proxy server, such as Nginx or Apache2.

The port, if unspecified, defaults to 8080. You should usually manually specify a port.

The "ignore_errors" option can be enabled to silence basic connection errors that might otherwise spam your console logs.

You can only exactly one webserver per port.
If you use multiple ports, you can thus have multiple webservers.

When using the stop instruction, you must specify the same port you used when starting.

The webserver only does anything if you properly handle Event:webserver web request

Most webserver processing is done in the event, and thus is synchronous with the minecraft thread, and thus may induce lag if not done with care.
Note per the event's meta, "file:" is handled async, and "cached_file:" only runs sync once per file.

This command must be enabled in the Denizen/config.yml before it can be used.
Related TagsNone
Usage Example
# Use to start a webserver on port 8081.
- webserver start port:8081
Usage Example
# Use to stop the webserver on port 8081.
- webserver stop port:8081
Groupcore
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/WebServerCommand.java#L29



Category: file


NameFileCopy
Syntaxfilecopy [origin:<origin>] [destination:<destination>] (overwrite)
Short DescriptionCopies a file from one location to another.
Full DescriptionCopies a file from one location to another.

The starting directory is server/plugins/Denizen.

May overwrite existing copies of files.

Note that in most cases this command should be ~waited for (like "- ~filecopy ..."). Refer to Language:~waitable.

This command can be disabled by setting Denizen config option "Commands.Filecopy.Allow copying files" to false.
Related Tags<entry[saveName].success> returns whether the copy succeeded (if not, either an error or occurred, or there is an existing file in the destination.)
Usage Example
# Use to copy a custom YAML data file to a backup folder, overwriting any old backup of it that exists.
- ~filecopy o:data/custom.yml d:data/backup.yml overwrite save:copy
- narrate "Copy success<&co> <entry[copy].success>"
Groupfile
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/file/FileCopyCommand.java#L29

NameFileRead
Syntaxfileread [path:<path>]
Short DescriptionReads the file at the given path.
Full DescriptionReads the file at the given path.

The starting directory is server/plugins/Denizen.

Note that in most cases this command should be ~waited for (like "- ~fileread ..."). Refer to Language:~waitable.

This command must be enabled by setting Denizen config option "Commands.File.Allow read" to true.
Related Tags<entry[saveName].data> returns a BinaryTag of the raw file content.
Usage Example
# Use to read 'myfile' and narrate the text content.
- ~fileread path:data/myfile.dat save:read
- narrate "Read data: <entry[read].data.utf8_decode>"
Groupfile
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/file/FileReadCommand.java#L26

NameFileWrite
Syntaxfilewrite [path:<path>] [data:<binary>]
Short DescriptionWrites the given raw data to the file at the given path.
Full DescriptionWrites the given raw data to the file at the given path.

Will overwrite any existing file at the path.

The starting directory is server/plugins/Denizen.

Directories will automatically be generated as-needed.

Note that in most cases this command should be ~waited for (like "- ~filewrite ..."). Refer to Language:~waitable.

This command must be enabled by setting Denizen config option "Commands.File.Allow write" to true.
Related TagsNone
Usage Example
# Use to write some simple text to 'myfile'
- ~filewrite path:data/myfile.dat data:<element[Hello].utf8_encode>
Groupfile
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/file/FileWriteCommand.java#L26

NameLog
Syntaxlog [<text>] (type:{info}/severe/warning/fine/finer/finest/none/clear) [file:<name>]
Short DescriptionLogs some debugging info to a file.
Full DescriptionThis is a quick and simple way to store debugging information for admins to read.

You just input a file name and some text, and it will store that information in the file with a date/time stamp and the chosen type ('INFO' by default).
If you don't want the date/time stamp and type, you can set the type to 'none' and it will only add the message text.

Regardless of type, each usage of the log command will add a new line to the file, you can't just keep adding to one line.

You might choose to use this to record some important things,
for example, every time a player uses a dangerous command you might log the player's name and their location, so you'll know who to blame if you find something damaged.

Remember that the file location is inside the server's primary folder. You most likely want to prefix file names with a folder name, For example: 'file:logs/security.log'

If the file or folder path you input do not already exist, they will be automatically created.

Warning: Remember that file operations are dangerous! A typo in the filename could ruin your server.
It's recommended you use this command minimally.

This command can be disabled by setting Denizen config option "Commands.Log.Allow logging" to false.

This should almost always be ~waited for. Refer to Language:~waitable.
Related TagsNone
Usage Example
# Use to log some information to a file.
- ~log "Security breach on level 3!" type:severe file:securitylog.txt
Usage Example
# Use to log a player's name and location when they did something dangerous.
- ~log "<player.name> used the '/EXPLODE' command at <player.location.simple>!" type:warning file:security.log
Usage Example
# Use to write information directly to a file.
- ~log "This won't have a date or type" type:none file:example.log
Usage Example
# Use to clear a log file and write some text at the start.
- ~log "// Log File Generated by my Denizen script, do not edit!" type:clear file:myfile.log
Usage Example
# Use to clear a log file entirely.
- ~log "" type:clear file:myfile.log
Synonyms (Search Aid)textfile
Groupfile
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/file/LogCommand.java#L26

NameYaml
Syntaxyaml [create]/[load:<file>]/[loadtext:<text> raw_format]/[unload]/[savefile:<file>]/[copykey:<source_key> <target_key> (to_id:<name>)]/[set <key>([<#>])(:<action>):<value> (data_type:{string}/integer/double/boolean/auto)] [id:<name>]
Short DescriptionEdits YAML data, especially for YAML files.
Full DescriptionEdits YAML configuration data.

This commands exists primarily for interoperability with pre-existing data files and other plugins.
It should never be used for storing data that only Denizen needs to use. Consider instead using Command:flag.

Use waitable syntax ("- ~yaml load:...") with load or savefile actions to avoid locking up the server during file IO.
Refer to Language:~waitable.

For loading and saving, the starting path is within 'plugins/Denizen'.
The file path follows standard system file path rules. That means '/' separators folders,
and '..' as a folder name means go-up-one folder, for example '../WorldGuard/config.yml' would load the WorldGuard plugin config.
Also be aware that some servers (Linux/Mac based) have case sensitive file systems while others (Windows based) don't.
Generally, when using existing paths, make sure your casing is correct. When creating new paths, prefer all-lowercase to reduce risk of issues.

Please note that all usages of the YAML command except for "load" and "savefile" arguments are purely in memory.
That means, if you use "set" to make changes, those changes will not be saved to any file, until you use "savefile".
Similarly, "create" does not create any file, instead it only creates a YAML object in RAM.

When loading, optionally specify 'raw_format' to indicate that this YAML file needs to maintain compatibility with some external system using raw YAML data
(for example, when altering YAML data files used by external plugins).
Note that this can have side effects of custom data disappearing (for example, the value "yes" gets magically converted to "true") or strange data parsing in.

In-memory changes to a loaded YAML object will mark that object as having changes. Before saving,
you can check whether the YAML object needs to be written to disk with the has_changes tag.

Note that the '.yml' extension is not automatically appended, and you will have to include that in filenames.

All usages of the YAML command must include the "id:" argument. This is any arbitrary name, as plaintext or from a tag,
to uniquely and globally identify the YAML object in memory. This ID can only be used by one YAML object at a time.
IDs are stored when "create" or "load" arguments are used, and only removed when "unload" is used.
If, for example, you have a unique YAML data container per-player, you might use something like "id:myscript_<player>".

For ways to use the "set" argument, refer to Language:data actions.

When setting a value directly, you can optionally specify "data_type" as "string", "integer", "double", "boolean", or "auto",
to force the input to a specific data type, which may be needed for compatibility with some external YAML files.
Only applicable when setting a single value, not lists/maps/etc.
'Auto' will attempt to choose the best type for the value.
Related Tags<yaml[<idname>].contains[<path>]> Returns true if the file has the specified path. (...)
<yaml[<idname>].read[<path>]> Returns the value from a data key on the YAML document as an ElementTag, ListTag, or MapTag.
<yaml[<idname>].list_keys[<path>]> Returns a ListTag of all the keys at the path (and not sub-keys). (...)
<yaml[<idname>].has_changes> Returns whether this YAML object has had changes since the last save or load.
Usage Example
# Use to create a new YAML file.
- yaml create id:myfile
Usage Example
# Use to load a YAML file from disk.
- ~yaml load:myfile.yml id:myfile
Usage Example
# Use to modify a YAML file similarly to a flag.
- yaml id:myfile set my.key:HelloWorld
Usage Example
# Use to save a YAML file to disk.
- ~yaml savefile:myfile.yml id:myfile
Usage Example
# Use to unload a YAML file from memory.
- yaml unload id:myfile
Usage Example
# Use to modify a YAML file similarly to a flag.
- yaml id:myfile set my.key:+:2
Usage Example
# Use to modify a YAML file similarly to a flag.
- yaml id:myfile set my.key[2]:hello
Usage Example
# Use to modify a copy the contents of one YAML key to a new owning key.
- yaml id:myfile copykey:my.first.key my.new.key
Usage Example
# Use to modify a copy the contents of one YAML key to a new owning key on a different YAML file.
- yaml id:myfile copykey:my.first.key my.new.key to_id:myotherfile
Groupfile
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/file/YamlCommand.java#L44



Category: GUI System


Namegui
Syntaxgui [open <script>/close]
Short DescriptionOpens a GUI script into a GUI or closes a currently open one.
Full DescriptionOpens the GUI script specified as a GUI, or closes a currently open one.
The GUI script must have a panel of any kind as it's element to be opened (which can contain any other elements within it).
Related TagsNone
Usage Example
# Opens a GUI script named "my_gui".
- gui open my_gui
Usage Example
# Closes the currently open GUI.
- gui close
GroupGUI System
Sourcehttps://github.com/DenizenScript/Clientizen/blob/master/src/main/java/com/denizenscript/clientizen/scripts/commands/GuiCommand.java#L18



Category: image


NameDraw
Syntaxdraw [id:<id>] [pixel/rectangle/oval/image:<image>] (width:<width>) (height:<height>) (filled) [x:<x>] [y:<y>] (color:<color>)
Short DescriptionDraws on an image.
Full DescriptionDraws a pixel, shape, or image onto an image.

"id:" - the id of the image to draw on, see Command:Image.
"x:" and "y:" - the position that should be drawn on, see Language:Image positions.

For pixels or shapes:
"color:" - a ObjectType:ColorTag of the color to draw in.

For non-pixel shapes:
"width:" and "height:" - the size of the shape being drawn, required.
"filled" - whether the shape should be filled or just a border. optional, defaults to false.

And for images:
"image:" - the image to draw, required.
"width:" and "height:" - the size to rescale the image being drawn to, optional.
Related TagsNone
Usage Example
# Use to draw a single red pixel in the top left corner of an image.
- draw id:image pixel x:0 y:0 color:red
Usage Example
# Use to draw a purple 100x100 filled circle in the top left of an image.
- draw id:image oval x:0 y:0 width:100 height:100 color:purple filled
Usage Example
# Use to draw the image with the id 'star' into the image with id 'sky'.
- draw id:sky image:star x:50 y:50
Groupimage
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/DrawCommand.java#L16

NameImage
Syntaximage [id:<id>] [load [image:<image>/path:<path>]]/[save [path:<path>] [format:<format>]]/[unload]
Short DescriptionLoads, saves, and unloads images.
Full DescriptionLoads, saves, and unloads images.

With "load", specify either a file path to read from or an image object to load.
With "save", specify a file path to save the image to and a format to save the image in (e.g. "png", "jpg", "bmp"...), defaults to "png".
For both of these the starting path is "plugins/Denizen".
Use waitable syntax ("- ~image") when loading or saving from a file to avoid locking up the server during file IO, refer to Language:~waitable.

All uses of the image command must include the "id:" argument. This is any arbitrary name, as plaintext or from a tag,
to uniquely and globally identify the image object in memory. This ID can only be used by one image object at a time.
IDs are stored when "load" is used, and only removed when "unload" is used.
Related TagsNone
Usage Example
# Use to load an image from a file into memory under the id "image".
- ~image id:image load path:data/image.png
Usage Example
# Use to load an image object from a definition, draw on it, then store it back into the definition.
- define image <image[width=50;height=50;background=blue]>
- image id:to_edit load image:<[image]>
- draw id:to_edit oval x:0 y:0 width:50 height:50 color:green
# Copy the image to avoid it auto-updating with the image loaded in under that id, can skip '.copy' if this doesn't matter for your use case.
- define image <image[to_edit].copy>
Usage Example
# Use to save an image into file and unload it.
- ~image id:image save path:data/image.png
- image id:image unload
Groupimage
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/ImageCommand.java#L27



Category: interface


NameNarrate
Syntaxnarrate [<text>] (center)
Short DescriptionPrints some text into the client's chat area.
Full DescriptionPrints some text into the client's chat area, optionally centering it.
When centering text, new lines will be split with each line being centered, and text wider than the chat HUD will be wrapped into multiple centered lines.
Related TagsNone
Usage Example
# Use to narrate text.
- narrate "Hello World!"
Usage Example
# Use to narrate some text in the center of the chat area.
- narrate "This is in the center!" center
Usage Example
# Use to narrate 2 centered lines.
- narrate "Hello!<n>This is centered!" center
Groupinterface
Sourcehttps://github.com/DenizenScript/Clientizen/blob/master/src/main/java/com/denizenscript/clientizen/scripts/commands/NarrateCommand.java#L17



Category: networking


NameServerEvent
Syntaxserverevent [id:<id>] (data:<map>)
Short DescriptionSends the server an event.
Full DescriptionSends the server the client is currently connected to an event, potentially including extra data.

Input is an ID (an identifier to be used by the server to recognize the event, choose a constant name to use), and an optional MapTag of context data.

Note that the server must be running Depenizen with the Clientizen Bridge enabled to receive events.
Related TagsNone
Usage Example
# Use to send the server an event with the id "something_happened"
- serverevent id:something_happened
Usage Example
# Use to send the server an event with the id "user" and supply a context map of basic data.
- serverevent id:user data:[name=Aya;message=Hello]
Usage Example
# Use to send the server an event with the id "something_happened" and supply a context map of more interesting data.
- definemap context:
    Denizen: scripting
    food: waffle
    loaded_entities: <client.loaded_entities.size>
- serverevent id:something_happened context:<[context]>
Groupnetworking
Sourcehttps://github.com/DenizenScript/Clientizen/blob/master/src/main/java/com/denizenscript/clientizen/scripts/commands/ServerEventCommand.java#L19



Category: queue


NameChoose
Syntaxchoose [<option>] [<cases>]
Short DescriptionChooses an option from the list of cases.
Full DescriptionChooses an option from the list of cases.
Intended to replace a long chain of simplistic if/else if or complicated script path selection systems.
Simply input the selected option, and the system will automatically jump to the most relevant case input.
Cases are given as a sub-set of commands inside the current command (see Usage for samples).

Optionally, specify "default" in place of a case to give a result when all other cases fail to match.

Cases must be static text. They may not contain tags. For multi-tag comparison, consider the IF command.
Any one case line can have multiple values in it - each possible value should be its own argument (separated by spaces).
Related TagsNone
Usage Example
# Use to choose the only case.
- choose 1:
  - case 1:
    - debug LOG "Success!"
Usage Example
# Use to choose the default case.
- choose 2:
  - case 1:
    - debug log "Failure!"
  - default:
    - debug log "Success!"
Usage Example
# Use for dynamically choosing a case.
- choose <[entity_type]>:
  - case zombie:
    - narrate "You slayed an undead zombie!"
  - case skeleton:
    - narrate "You knocked the bones out of a skeleton!"
  - case creeper:
    - narrate "You didn't give that creeper a chance to explode!"
  - case pig cow chicken:
    - narrate "You killed an innocent farm animal!"
  - default:
    - narrate "You killed a <[entity_type].to_titlecase>!"
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/ChooseCommand.java#L26

NameDefine
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/definitions.html
Syntaxdefine [<id>](:<action>)[:<value>]
Short DescriptionCreates a temporary variable inside a script queue.
Full DescriptionDefinitions 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 Language: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
# Use to make complex tags look less complex, and scripts more readable.
- narrate "You invoke your power of notice..."
- define range <player.flag[range_level].mul[3]>
- define blocks <player.flag[noticeable_blocks]>
- define count <player.location.find_blocks[<[blocks]>].within[<[range]>].size>
- narrate "<&[base]>[NOTICE] You have noticed <[count].custom_color[emphasis]> blocks in the area that may be of interest."
Usage Example
# Use to validate a player input to a command script, and then output the found player's name.
- define target <server.match_player[<context.args.get[1]>]||null>
- if <[target]> == null:
  - narrate "<red>Unknown player target."
  - stop
- narrate "You targeted <[target].name>!"
Usage Example
# Use to keep the value of a tag that you might use many times within a single script.
- define arg1 <context.args.get[1]>
- if <[arg1]> == hello:
    - narrate Hello!
- else if <[arg1]> == goodbye:
    - narrate Goodbye!
Usage Example
# Use to remove a definition.
- define myDef:!
Usage Example
# Use to make a MapTag definition and set the value of a key inside.
- define myroot.mykey MyValue
- define myroot.myotherkey MyOtherValue
- narrate "The main value is <[myroot.mykey]>, and the map's available key set is <[myroot].keys>"
Synonyms (Search Aid)definition
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/DefineCommand.java#L27

NameDefineMap
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/definitions.html
Syntaxdefinemap [<name>] [<key>:<value> ...]
Short DescriptionCreates a MapTag definition with key/value pairs constructed from the input arguments.
Full DescriptionCreates a MapTag definition with key/value pairs constructed from the input arguments.
Related Tags<[<id>]> to get the value assigned to an ID
Usage Example
# Use to make a MapTag definition with three inputs.
- definemap my_map count:5 type:Taco smell:Tasty
Usage Example
# Use to make a MapTag definition with complex input.
- definemap my_map:
    count: 5
    some_list:
    - a
    - b
    some_submap:
        some_subkey: taco
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/DefineMapCommand.java#L26

NameDetermine
Related Guide Pagehttps://guide.denizenscript.com/guides/first-steps/world-script.html
Syntaxdetermine (passively) [<value>]
Short DescriptionSets the outcome of a script.
Full DescriptionSets the outcome of a script.
The most common use case is within script events (for example, to cancel the event).
This is also required for all procedure scripts.
It may be useful in other cases (such as a task script that returns a result, via the save argument).

By default, the determine command will end the queue (similar to Command:stop).
If you wish to prevent this, specify the "passively" argument.

To make multiple determines, simply use the determine command multiple times in a row, with the "passively" argument on each.
Related Tags<QueueTag.determination> Returns the values that have been determined via Command:Determine (...)
Usage Example
# Use to modify the result of an event.
- determine message:<context.message.to_lowercase>
Usage Example
# Use to cancel an event, but continue running script commands.
- determine passively cancelled
Synonyms (Search Aid)return
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/DetermineCommand.java#L23

NameElse
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/if-command.html
Syntaxelse (if <comparison logic>)
Short DescriptionHelper command for usage with the if command.
Full DescriptionA helper command to use with if commands.
See Command:if command documentation.
Related TagsSee IF command documentation.
Usage Example
# See IF command documentation.
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/ElseCommand.java#L17

NameForeach
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/loops.html
Syntaxforeach [stop/next/<object>|...] (as:<name>) (key:<name>) [<commands>]
Short DescriptionLoops through a ListTag, running a set of commands for each item.
Full DescriptionLoops through a ListTag of any type. For each item in the ListTag, the specified commands will be ran for that list entry.

Alternately, specify a map tag to loop over the set of key/value pairs in the map, where the key will be <[key]> and the value will be <[value]>.
Specify "key:<name>" to set the key definition name (if unset, will be "key").

Specify "as:<name>" to set the value definition name (if unset, will be "value").
Use "as:__player" to change the queue's player link, or "as:__npc" to change the queue's NPC link.
Note that a changed player/NPC link persists after the end of the loop.

To end a foreach loop, do - foreach stop

To jump immediately to the next entry in the loop, do - foreach next

Note that many commands and tags in Denizen support inputting a list directly, making foreach redundant for many simpler cases.

Note that if you delay the queue (such as with Command:wait or Language:~waitable) inside a foreach loop,
the loop can't process the next entry until the delay is over.
This can lead to very long waits if you have a long list and a wait directly in the loop, as the total delay is effectively multiplied by the number of iterations.
Use Command:run if you want to run logic simultaneously for many entries in a list in a way that allows them to separately wait without delaying each other.
Related Tags<[value]> to get the current item in the loop
<[loop_index]> to get the current loop iteration number
Usage Example
# Use to run commands 'for each entry' in a manually created list of objects/elements.
- foreach <[some_entity]>|<[some_npc]>|<[player]> as:entity:
    - announce "There's something at <[entity].location>!"
Usage Example
# Use to iterate through entries in any tag that returns a list.
- foreach <player.location.find_entities[zombie].within[50]> as:zombie:
    - narrate "There's a zombie <[zombie].location.distance[<player.location>].round> blocks away"
Usage Example
# Use to iterate through a list of players and run commands automatically linked to each player in that list.
- foreach <server.online_players> as:__player:
    - narrate "Thanks for coming to our server, <player.name>! Here's a bonus $50.00!"
    - money give quantity:50
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/ForeachCommand.java#L31

NameGoto
Syntaxgoto [<name>]
Short DescriptionJump forward to a location marked by Command:mark.
Full DescriptionJumps forward to a marked location in the script.
For example:

- goto potato
- narrate "This will never show"
- mark potato


Most scripters should never use this. This is only for certain special cases.
Related TagsNone
Usage Example
# Use to jump forward to a location.
- goto potato
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/GotoCommand.java#L24

NameIf
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/if-command.html
Syntaxif [<value>] (!)(<operator> <value>) (&&/|| ...) [<commands>]
Short DescriptionCompares values, and runs a subset of commands if they match.
Full DescriptionCompares values, and runs a subset of commands if they match.
Works with the else command, which handles alternatives for when the comparison fails.
The if command is equivalent to the English phrasing "if something is true, then do the following".

Values are compared using the comparable system. See Language:operator for information.

Comparisons may be chained together using the symbols '&&' and '||' or their text equivalents 'and' and 'or'.
'&&' means "and", '||' means "or".
So, for example "if <[a]> && <[b]>:" requires both a AND b to be true.
"if <[a]> and <[b]>:" also requires both a AND b to be true.

The "or" is inclusive, meaning "if <[a]> || <[b]>:" will pass for any of the following:
a = true, b = true
a = true, b = false
a = false, b = true
but will fail when a = false and b = false.

Sets of comparisons may be grouped using ( parens ) as separate arguments.
So, for example "if ( <[a]> && <[b]> ) || <[c]>", or "if ( <[x]> or <[y]> or <[z]> ) and ( <[a]> or <[b]> or <[c]> )"
Grouping is REQUIRED when using both '&&' and '||' in one line. Otherwise, groupings should not be used at all.

Boolean inputs and groups both support negating with the '!' symbol as a prefix.
This means you can do "if !<[a]>" to say "if a is NOT true".
Similarly, you can do "if !( <[a]> || <[b]> )", though be aware that per rules of boolean logic,
that example is the exactly same as "if !<[a]> && !<[b]>".

You can also use keyword "not" as its own argument to negate a boolean or an operator.
For example, "if not <[a]>:" will require a to be false, and "if <[a]> not equals <[b]>:" will require that 'a' does not equal 'b'.

When not using a specific comparison operator, true vs false will be determined by Truthiness, see Tag:ObjectTag.is_truthy for details.
For example, "- if <player||null>:" will pass if a player is linked, valid, and online.
Related Tags<ObjectTag.is[<operator>].to[<element>]> Takes an operator, and compares the first object to the given second object. (...)
<ObjectTag.is[<operator>].than[<element>]> Takes an operator, and compares the first object to the given second object. (...)
Usage Example
# Use to narrate a message only if a player has a flag.
- if <player.has_flag[secrets]>:
    - narrate "The secret number is 3!"
Usage Example
# Use to narrate a different message depending on a player's money level.
- if <player.money> > 1000:
    - narrate "You're rich!"
- else:
    - narrate "You're poor!"
Usage Example
# Use to stop a script if a player doesn't have all the prerequisites.
- if !<player.has_flag[quest_complete]> || !<player.has_permission[new_quests]> || <player.money> < 50:
    - narrate "You're not ready!"
    - stop
- narrate "Okay so your quest is to find the needle item in the haystack build next to town."
Usage Example
# Use to perform a complicated requirements test before before changing some event.
- if ( poison|magic|melting contains <context.cause> and <context.damage> > 5 ) or <player.has_flag[weak]>:
    - determine <context.damage.mul[2]>
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/IfCommand.java#L28

NameInject
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/run-options.html
Syntaxinject [<script>] (path:<name>) (instantly)
Short DescriptionRuns a script in the current queue.
Full DescriptionInjects a script into the current queue.
This means this task will run with all of the original queue's definitions and tags.
It will also now be part of the queue, so any delays or definitions used in the injected script will be accessible in the original queue.
Related TagsNone
Usage Example
# Injects the InjectedTask task into the current queue
- inject InjectedTask
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/InjectCommand.java#L25

NameMark
Syntaxmark [<name>]
Short DescriptionMarks a location for Command:goto.
Full DescriptionMarks a location for the goto command. See Command:goto for details.
Related TagsNone
Usage Example
# Use to mark a location.
- mark potato
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/MarkCommand.java#L18

NameQueue
Syntaxqueue (<queue>) [clear/stop/pause/resume/delay:<duration>]
Short DescriptionModifies the current state of a script queue.
Full DescriptionAllows queues to be modified during their run. This can also be used to modify other queues currently running.

Clearing a queue will remove any commands still queued within it, and thus end the queue.
When trying to clear the current queue, use Command:stop instead.

Using the "stop" argument will force the queue to immediately stop running.
When trying to stop the current queue, use Command:stop instead.

Using the "delay:<duration>" argument will cause the queue to wait for a specified duration.
When trying to delay the current queue, use Command:wait instead.

Using the "pause" argument will freeze the queue but keep it listed, waiting for a "resume" instruction.
It is of course not possible to resume the current queue (as if you're running a 'queue' command, the queue can't be paused).

Generally, the queue is considered a non-ideal way of doing things - that is, there's usually a better/cleaner way to achieve similar results.
It's most useful within the "/ex" command for quick problem solving
(eg if a script in testing gets caught in an infinite loop, you can do "/ex queue ID_HERE stop" to fix that).
Related Tags<queue> Returns a queue object constructed from the input value. (...)
<QueueTag.id> Returns the full textual id of the queue.
<QueueTag.size> Returns the number of script entries in the queue.
<util.queues> Returns a list of all currently running queues on the server.
<ScriptTag.queues> Returns all queues which are running for this script.
Usage Example
# Use to force-stop a given queue.
- queue <server.flag[OtherQueue]> clear
Usage Example
# Use to delay the current queue (use <@link command wait> instead!)
- queue delay:5t
Usage Example
# Use to pause the given queue.
- queue <server.flag[OtherQueue]> pause
Usage Example
# Use to resume the given queue.
- queue <server.flag[OtherQueue]> resume
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/QueueCommand.java#L22

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

NameRateLimit
Syntaxratelimit [<object>] [<duration>]
Short DescriptionLimits the rate that queues may process a script at.
Full DescriptionLimits the rate that queues may process a script at.
If another queue tries to run the same script faster than the duration, that second queue will be stopped.

Note that the rate limiting is tracked based on two unique factors: the object input, and the specific script line.
That is to say: if you have a 'ratelimit <player> 10s', and then a few lines down a 'ratelimit <player> 10s',
those are two separate rate limiters.
Additionally, if you have a 'ratelimit <player> 10s' and two different players run it, they each have a separate rate limit applied.

Note that this uses game delta tick time, not system realtime.
Related TagsNone
Usage Example
# Use to show a message to a player no faster than once every ten seconds.
- ratelimit <player> 10s
- narrate "Wow!"
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/RateLimitCommand.java#L24

NameRepeat
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/loops.html
Syntaxrepeat [stop/next/<amount>] (from:<#>) (as:<name>) [<commands>]
Short DescriptionRuns a series of braced commands several times.
Full DescriptionLoops through a series of braced commands a specified number of times.
To get the number of loops so far, you can use <[value]>.

Optionally, specify "as:<name>" to change the definition name to something other than "value".

Optionally, to specify a starting index, use "from:<#>". Note that the "amount" input is how many loops will happen, not an end index.
The default "from" index is "1". Note that the value you give to "from" will be the value of the first loop.

To stop a repeat loop, do - repeat stop

To jump immediately to the next number in the loop, do - repeat next
Related Tags<[value]> to get the number of loops so far
Usage Example
# Use to loop through a command five times.
- repeat 5:
    - announce "Announce Number <[value]>"
Usage Example
# Use to announce the numbers: 1, 2, 3, 4, 5.
- repeat 5 as:number:
    - announce "I can count! <[number]>"
Usage Example
# Use to announce the numbers: 21, 22, 23, 24, 25.
- repeat 5 from:21:
    - announce "Announce Number <[value]>"
Synonyms (Search Aid)for
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/RepeatCommand.java#L28

NameRun
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/run-options.html
Syntaxrun [<script>] (path:<name>) (def:<element>|.../defmap:<map>/def.<name>:<value>) (id:<name>) (speed:<value>/instantly) (delay:<value>)
Short DescriptionRuns a script in a new queue.
Full DescriptionRuns a script in a new queue.

You must specify a script object to run.

Optionally, use the "path:" argument to choose a specific sub-path within a script.

Optionally, use the "def:" argument to specify definition values to pass to the script,
the definitions will be named via the "definitions:" script key on the script being ran,
or numerically in order if that isn't specified (starting with <[1]>).

Alternately, use "defmap:<map>" to specify definitions to pass as a MapTag, where the keys will be definition names and the values will of course be definition values.

Alternately, use "def.<name>:<value>" to define one or more named definitions individually.

Optionally, use the "speed:" argument to specify the queue command-speed to run the target script at,
or use the "instantly" argument to use an instant speed (no command delay applied).
If neither argument is specified, the default queue speed applies (normally instant, refer to the config file).
Generally, prefer to set the "speed:" script key on the script to be ran, rather than using this argument.

Optionally, use the "delay:" argument to specify a delay time before the script starts running.

Optionally, specify the "id:" argument to choose a custom queue ID to be used.
If none is specified, a randomly generated one will be used. Generally, don't use this argument.

The run command is ~waitable. Refer to Language:~waitable.
Related Tags<entry[saveName].created_queue> returns the queue that was started by the run command.
Usage Example
# Use to run a task script named 'MyTask'.
- run MyTask
Usage Example
# Use to run a task script named 'MyTask' that isn't normally instant, instantly.
- run MyTask instantly
Usage Example
# Use to run a local subscript named 'alt_path'.
- run <script> path:alt_path
Usage Example
# Use to run 'MyTask' and pass 3 definitions to it.
- run MyTask def:A|Second_Def|Taco
Usage Example
# Use to run 'MyTask' and pass 3 named definitions to it.
- run MyTask def.count:5 def.type:Taco def.smell:Tasty
Usage Example
# Use to run 'MyTask' and pass a list as a single definition.
- run MyTask def:<list_single[<list[a|big|list|here]>]>
# MyTask can then get the list back by doing:
- define mylist <[1]>
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/RunCommand.java#L31

NameRunLater
Syntaxrunlater [<script>] (path:<name>) [delay:<duration>] (id:<id>) (def:<element>|.../defmap:<map>/def.<name>:<value>)
Short DescriptionCauses a task to run sometime in the future, even if the server restarts.
Full DescriptionCauses a task to run sometime in the future, even if the server restarts.

Script, path, and definition inputs work the exact same as with Command:run.

This command will store intended script runs to a file, so that even if the server restarts, they will still run.
Script runs are guaranteed to happen after the time is up - if the server is turned off at the scheduled time, they will run at next startup.
The guarantee can be broken if the server crashes or other errors occur.

The delay input is a DurationTag instance, that is relative to system time (not server delta time).

Definitions and queue object links will be preserved, so long as they remain valid at time of execution.
Objects that are lost before the delay is up (such as a linked NPC that is removed) may cause errors.

You can optionally specify the "id" argument to provide a unique tracking ID for the intended future run, which can then also be used to cancel it via Mechanism:system.cancel_runlater.
If you use IDs, they must be unique - you cannot have the same ID scheduled twice. Use Tag:util.runlater_ids if you need to dynamically check if an ID is in use.

Implementation note: the system that tracks when scripts should be ran is a fair bit more optimized than 'wait' commands or the 'run' command with a delay,
specifically for the case of very large delays (hours or more) - in the short term, 'wait' or 'run' with a delay will be better.
Related Tags<util.runlater_ids> Returns a list of all scheduled task IDs for Command:runlater. (...)
Usage Example
# Use to run a task script named 'example' 3 days later.
- runlater example delay:3d
Usage Example
# Use to run a task script named 'my_task' 5 hours later with definition 'targets' set to a list of all the players that were near the player before the delay.
- runlater my_task delay:5h def.targets:<player.location.find_players_within[50]>
Usage Example
# Use to plan to go for a jog tomorrow then change your mind after 5 seconds.
- runlater go_for_jog id:healthy_plan delay:1d
- wait 5s
- adjust system cancel_runlater:healthy_plan
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/RunLaterCommand.java#L36

NameStop
Syntaxstop
Short DescriptionStops the current queue.
Full DescriptionThis will immediately stop the current queue, preventing it from processing any further.
Related Tags<queue> to get the current queue.
Usage Example
# Use to stop the current queue.
- stop
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/StopCommand.java#L16

NameWait
Syntaxwait (<duration>) (queue:<name>) (system/{delta})
Short DescriptionDelays a script for a specified amount of time.
Full DescriptionPauses the script queue for the duration specified. If no duration is specified it defaults to 3 seconds.
Accepts the 'queue:<name>' argument which allows the delay of a different queue.

Accepts a 'system' argument to delay based on system time (real-world time on a clock).
When that argument is not used, waits based on delta time (in-game time tracking, which tends to vary by small amounts, especially when the server is lagging).
Generally, do not use the 'system' argument unless you have a specific good reason you need it.
Related Tags<QueueTag.speed> Returns the speed of the queue as a Duration. A return of '0' implies it is 'instant'. (...)
Usage Example
# Use to delay the current queue for 1 minute.
- wait 1m
Usage Example
# Use to delay the current queue until 1 hour of system time passes.
- wait 1h system
Synonyms (Search Aid)delay
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/WaitCommand.java#L22

NameWaitUntil
Syntaxwaituntil (rate:<duration>) (max:<duration>) [<comparisons>]
Short DescriptionDelays a script until the If comparisons return true.
Full DescriptionDelays a script until the If comparisons return true. Refer to Command:if for if command syntax information.

Optionally, specify an update rate (if unset, will update at queue speed).
The update rate controls how often the tag will be checked. This generally doesn't need to be set, unless you're concerned about script efficiency.
Never set this to faster than queue update rate.

Optionally specify a maximum duration to wait for (delta time).
Related Tags<QueueTag.speed> Returns the speed of the queue as a Duration. A return of '0' implies it is 'instant'. (...)
Usage Example
# Use to delay the current queue until the player respawns (useful in a death event, for example).
- waituntil <player.is_spawned>
Usage Example
# Use to delay the current queue until the player is healed, only checking once per second.
- waituntil rate:1s <player.health> > 15
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/WaitUntilCommand.java#L29

NameWhile
Related Guide Pagehttps://guide.denizenscript.com/guides/basics/loops.html
Syntaxwhile [stop/next/[<value>] (!)(<operator> <value>) (&&/|| ...)] [<commands>]
Short DescriptionRuns a series of braced commands until the tag returns false.
Full DescriptionRuns a series of braced commands until the if comparisons returns false. Refer to Command:if for if command syntax information.
To end a while loop, use the 'stop' argument.
To jump to the next entry in the loop, use the 'next' argument.
Related Tags<[loop_index]> to get the number of loops so far.
Usage Example
# Use to loop until a player sneaks, or the player goes offline. (Note: generally use 'waituntil' for this instead)
- while !<player.is_sneaking> && <player.is_online>:
    - narrate "Waiting for you to sneak..."
    - wait 1s
Groupqueue
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/queue/WhileCommand.java#L26



Category: world


NameParticle
Syntaxparticle [type:<particle>] [at:<location>] (velocity:<velocity>) (color:<color>) (duration:<duration>) (scale_multiplier:<#.#>) (data:<map>/raw_data:<data>)
Short DescriptionSpawns a particle in the world.
Full DescriptionSpawns a particle of the specified type in the world.
The type can be any particle type, including ones added by other mods - see 🔗https://minecraft.wiki/w/Particles_(Java_Edition)#Types_of_particles for all vanilla particle types.
The location can be any location to play the particle at.
The velocity is a vector location for the particle's movement, which overrides its default movement (if any).
The color will override the particle's color or color its texture (depending on the particle), and can be any color.
Alpha is supported by some particles, and will change their transparency.
The duration is the amount of time the particle will exist for before disappearing.
The scale multiplier is a multiplier for the particle's size, which applies on top of any scaling the particle might already have (so particles with varying sizes will still have varying sizes, for example).
The data is a map of custom data for the particle (see below).
Raw data is an alternative data input that takes in text in the same format as the "/particle" command and parses it into the particle's data. Should generally prefer the "data:" argument.

"block", "block_marker", and "falling_dust" take:
- ObjectType:MaterialTag "material" key, for the particle's block type.
"dust" takes:
- ObjectType:ColorTag "color" key, for the dust's color.
- ObjectType:ElementTag(Decimal) "scale" key, for the dust's size.
"dust_color_transition" takes:
- ObjectType:ColorTag "from" key, for the color to transition from.
- ObjectType:ColorTag "to" key, for the color to transition to.
- ObjectType:ElementTag(Decimal) "scale" key, for the dust's size.
"sculk_charge" takes:
- ObjectType:ElementTag(Decimal) "roll" key, for the charge's angle in radians (see also Tag:ElementTag.to_radians).
"item" takes:
- ObjectType:ItemTag "item" key, for the item the particle displays.
"vibration" takes:
- ObjectType:DurationTag "arrival_time" key, for the amount of time it takes the particle to reach its destination.
- And a destination, which can be either:
- ObjectType:LocationTag "location" key, for the particle to travel to a specific location.
- ObjectType:EntityTag "entity" key, for the particle to travel to an entity.
- When specifying an entity, optionally include a ObjectType:ElementTag(Decimal) "y_offset" key for the particle to target a position above the entity's location.
"shriek" takes:
- ObjectType:DurationTag "delay" key, for the amount of time the particle should wait before spawning.
Related TagsNone
Usage Example
# Use to spawn a large flame particle above the player.
- particle type:flame at:<client.self_entity.location.above[2.5]> scale_multiplier:4
Usage Example
# Use to spawn a dust color transition particle that changes color from red to blue.
- particle type:dust_color_transition at:<[location]> data:[from=red;to=blue;scale=2]
Usage Example
# Use to spawn a block marker particle of a stone block that slowly moves upwards.
- particle type:block_marker at:<[location]> data:[material=stone] velocity:0,0.1,0
Groupworld
Sourcehttps://github.com/DenizenScript/Clientizen/blob/master/src/main/java/com/denizenscript/clientizen/scripts/commands/ParticleCommand.java#L41