Denizen Script Meta Documentation Search


Learn about how Denizen works in The Beginner's Guide.
Showing 14 search results for filter out of 3928 meta-documentation entries...

Partial Name Match Results



Tag


Name<ListTag.filter_tag[<dynamic-boolean>]>
ReturnsListTag
DescriptionReturns a copy of the list with all its contents parsed through the given input tag and only including ones that returned 'true'.
This requires a fully formed tag as input, making use of the 'filter_value' definition.
Example
# Narrates a list of '3|4|5'
- narrate <list[1|2|3|4|5].filter_tag[<[filter_value].is_more_than[3]>]>
Example
# Narrates a list of '4|5'
- narrate <list[1|2|3|4|5].filter_tag[<list[4|5].contains[<[filter_value]>]>]>
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/objects/core/ListTag.java#L2428
Name<ListTag.filter[<tag>]>
ReturnsListTag
DescriptionReturns a copy of the list with all its contents parsed through the given tag and only including ones that returned 'true'.
One should generally prefer Tag:ListTag.filter_tag.
Example
# Narrates a list of '3|4|5'
- narrate <list[1|2|3|4|5].filter[is_more_than[3]]>
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/objects/core/ListTag.java#L2328
Name<MapTag.filter_tag[<parseable-boolean>]>
ReturnsMapTag
DescriptionReturns a copy of the map with all its contents parsed through the given input tag and only including ones that returned 'true'.
This requires a fully formed tag as input, making use of the 'filter_key' and 'filter_value' definition.
Example
# Narrates a map of '[c=3;d=4;e=5]'
- narrate <map[a=1;b=2;c=3;d=4;e=5].filter_tag[<[filter_value].is[or_more].than[3]>]>
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/objects/core/MapTag.java#L481

Semi-Decent Match Results



Command


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

Event


Nameplayer client options change
Event Lines player client options change
Triggerswhen a player changes their client options.
Generated Exampleson player client options change:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.server_listings_enabled> returns a ElementTag(Boolean) of whether the player has server listings enabled. Available only on MC 1.19+.
<context.chat_visibility> returns an ElementTag of the player's chat visibility. Valid chat visibility options can be found at 🔗https://jd.papermc.io/paper/1.20/com/destroystokyo/paper/ClientOption.ChatVisibility.html
<context.locale> returns an ElementTag of the player's current locale.
<context.main_hand> returns a ElementTag of the player's main hand. Can either be LEFT or RIGHT.
<context.skin_parts> returns a MapTag of whether the player's skin parts are enabled or not. For example: [cape=true;jacket=false;left_sleeve=true;right_sleeve=false;left_pants=true;right_pants=false;hat=true]
<context.view_distance> returns a ElementTag(Number) of the player's view distance.
<context.server_listings_changed> returns a ElementTag(Boolean) of whether the player's server listings have changed. Available only on MC 1.19+.
<context.chat_colors> returns a ElementTag(Boolean) of whether the player has chat colors enabled.
<context.chat_colors_changed> returns a ElementTag(Boolean) of whether the player has toggled their chat colors.
<context.chat_visibility_changed> returns a ElementTag(Boolean) of whether the player's chat visibility has changed. Available only on MC 1.19+.
<context.locale_changed> returns a ElementTag(Boolean) of whether the player's locale has changed.
<context.main_hand_changed> returns a ElementTag(Boolean) of whether the player's main hand has changed.
<context.skin_parts_changed> returns a ElementTag(Boolean) of whether the player's skin parts have changed.
<context.text_filtering_changed> returns a ElementTag(Boolean) of whether the player's text filtering has changed. Available only on MC 1.19+.
<context.text_filtering_enabled> returns a ElementTag(Boolean) of whether the player has text filtering enabled. Available only on MC 1.19+.
<context.view_distance_changed> returns a ElementTag(Boolean) of whether the player's view distance has changed.
GroupPaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/PlayerClientOptionsChangeScriptEvent.java#L18

Language


Name/denizen debug command
DescriptionUsing the /denizen debug command interfaces with Denizen's debugger to allow control over debug messages.

To enable debugging mode, simply type '/denizen debug'.
While debug is enabled, all debuggable scripts, and any invoked actions, will output information to the console as they are executed.
By default, all scripts are debuggable while the debugger is enabled.
To disable a script specifically from debugging, simply add the 'debug:' node with a value of 'false' to your script container.
This is typically used to silence particularly spammy scripts. Any kind of script container can be silenced using this method.

To stop debugging, simply type the '/denizen debug' command again.
This must be used without any additional options. A message will be sent to show the current status of the debugger.

Note: you should almost NEVER disable debug entirely. Instead, always disable it on a per-script basis.
If debug is globally disabled, that will hide important error messages, not just normal debug output.

There are also several options to further help debugging. To use an option, simply attach them to the /denizen debug command.
One option, or multiple options can be used. For example: /denizen debug -sbi

'-c' enables/disables color. This is sometimes useful when debugging with a non-color console.
'-r' enables recording mode. See also: /denizen submit command
'-s' enables/disables stacktraces generated by Denizen. We might ask you to enable this when problems arise.
'-b' enables/disables the ScriptBuilder debug. When enabled, Denizen will show info on script and argument creation. Warning: Can be spammy.
'-n' enables/disables debug trimming. When enabled, messages longer than 1024 characters will be 'snipped'.
'-i' enables/disables source information. When enabled, debug will show where it came from (when possible).
'-p' enables/disables packet debug logging. When enabled, all packets sent to players (from anywhere) will be logged to console.
or, '--pfilter (filter)' to enable packet debug logging with a string contain filter.
'-f' enables/disables showing of future warnings. When enabled, future warnings (such as upcoming deprecations) will be displayed in console logs.
'-e' enables/disables extra output. This will spam more information about various internal things.
'-v' enables/disables advanced ultra-verbose log output. This will *flood* your console super hard.
'-o' enables/disables 'override' mode. This will display all script debug, even when 'debug: false' is set for scripts.
'-l' enables/disables script loading information. When enabled, '/ex reload' will produce a potentially large amount of debug output.
GroupConsole Commands
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/utilities/command/DenizenCommandHandler.java#L93
NameMythicMobs Bridge
DescriptionIn addition to the tags, commands, and events found by searching for "mythicmobs" throughout the meta documentation,
Depenizen adds 4 new Denizen matchers, and additional features to Mythic Mobs: 2 Targeters, and a Condition.

Depenizen provides additional ObjectType:EntityTag and ObjectType:ItemTag matchers to match MythicMobs mobs/items:
- "mythic_mob" plaintext EntityTag matcher, matches if the entity is a mythic mob.
- "mythic_mob:<MythicMobID>" EntityTag matcher, matches if the entity is a mythic mob, and its ID matches the advanced matcher specified.
- "mythic_item" plaintext ItemTag matcher, matches if the item is a mythic item.
- "mythic_item:<MythicItemID>" ItemTag matcher, matches if the item is a mythic item, and its ID matches the advanced matcher specified.

Depenizen provides two additional targeters via the MythicMobs API: @DenizenEntity is an entity-based targeter, @DenizenLocation is a location-based targeter.
Both targeters can parse tags; they accept input of either an EntityTag or LocationTag respectively.
Both targeters also support returning ListTags containing their respective tag types.
Both targeters provide <context.entity> as an EntityTag of the caster.

Conditions provide different contexts depending on their usage.
The syntax for calling a Denizen tag as a condition is DenizenCondition.
The tag should return an ElementTag of a boolean value (true or false).
<context.location> is available for location-based checks,
<context.entity> is available for entity-based and caster-based checks,
and <context.target> is available for target-based checks.
NOTE: TriggerConditions are NOT currently supported.

Note as well that many parts of MythicMobs configurations allow usage of PlaceholderAPI, which means you can use the "denizen_" placeholder to read tags in any such parts,
refer to Language:PlaceholderAPI Bridge for more information.

Usage Examples

Example 1: @DenizenEntity{tag=<context.entity.location.find_players_within[30].filter[has_flag[marked]]>}

Example 2: @DenizenLocation{tag=<context.entity.location.find.surface_blocks.within[30].random[5]>}

Example 3: @DenizenEntity{tag=<proc[SomeProcScript]>}

Conditions:
- denizencondition{tag=<context.entity.location.find_players_within[30].is_empty.not>}
GroupDepenizen Bridges
RequiresDepenizen, MythicMobs
Sourcehttps://github.com/DenizenScript/Depenizen/blob/master/src/main/java/com/denizenscript/depenizen/bukkit/utilities/mythicmobs/MythicMobsLoaders.java#L20
NameProcedure Script Containers
DescriptionProcedure script containers are used to define a script that can be ran through a tag.

Generally called via Tag:proc or Tag:proc.context.

The only required key is 'script:'.

Note that procedure scripts must NEVER change external state.
That is, a procedure script cannot change anything at all, ONLY determine a value.
Setting a flag, loading a YAML document, placing a block, etc. are all examples of external changes that are NOT allowed.

This restriction comes from two main reasons:
- Tags run in arbitrary conditions. They may be read asynchronously or in other weird circumstances that can result
in applied changes crashing your server or other unexpected side effects.
- Tags can run for a variety of reasons.
If you were to make a proc script 'spawn_entity' that actually spawns an entity into the world,
you would likely end up with a *lot* of unintentional entity spawns.
Some tags will be read multiple times when theoretically ran once,
in some circumstances a tag read might even be based on user input! (Particularly if you ever make use of the '.parsed' tag,
or the list.parse/filter/sort_by_number tags).
Imagine if for example, a tag can be read when users input a specific custom command,
and a clever user finds out they can type "/testcommand 32 <proc[spawn_entity].context[creeper]>"
to spawn a creeper ... that would be a major problem!
In general, maximum caution is the best for situations like this... simply *never* make a procedure
that executes external changes.


Proc_Script_Name:

    type: procedure

    # Optionally specify definition names to use with the 'context' input of the proc tag.
    definitions: def|names|here

    script:

    # Put any logic, then determine the result.
    - determine 5

GroupScript Container System
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/containers/core/ProcedureScriptContainer.java#L9

Tag


Name<ChunkTag.entities[(<entity>|...)]>
ReturnsListTag(EntityTag)
DescriptionReturns a list of entities in the chunk.
Optionally specify entity types to filter down to.
Example
# Loops though the entities found in the player's chunk and narrates the name and location of it.
- foreach <player.location.chunk.entities> as:entity:
    - narrate "Found a <[entity].name> at <[entity].location.simple>!"
Example
# Loops though the axolotls found in the player's chunk and narrates the name and location of it.
- foreach <player.location.chunk.entities[axolotl]> as:entity:
    - narrate "Found an axolotl at <[entity].location.simple>!"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/ChunkTag.java#L509
Name<MapTag.sort_by_value[(<tag>)]>
ReturnsMapTag
DescriptionReturns a copy of the map, sorted alphanumerically by the value under each key.
Optionally, specify a tag to apply to the value.
To sort by key, use Tag:MapTag.get_subset with list sort tags, like 'map.get_subset[map.keys.sort_by_value[...]]'.
This also lets you apply list filters or similar to the keyset.
To apply a '.parse' to the values, use Tag:ListTag.map_with, like 'map.keys.map_with[map.values.parse[...]]'
Example
# Narrates a map of [a=1;b=2;c=3]
- narrate <map[c=3;a=1;b=2].sort_by_value>
Example
# Narrates a map of [c=3;b=2;a=1]
- narrate <map[c=3;a=1;b=2].sort_by_value[mul[-1]]>
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/objects/core/MapTag.java#L432
Name<PlayerTag.client_options>
ReturnsMapTag
DescriptionReturns the player's client options.
The output map contains the following keys:
- 'allow_server_listings' (ElementTag(Boolean)): whether the player allows server listings. Available only on MC 1.19+.
- 'chat_colors_enabled' (ElementTag(Boolean)): whether the player has chat colors enabled.
- 'chat_visibility' (ElementTag): the player's current chat visibility option. Possible output values are: FULL, SYSTEM, HIDDEN, and UNKNOWN.
- 'locale' (ElementTag): the player's current locale.
- 'main_hand' (ElementTag): the player's main hand, either LEFT or RIGHT.
- 'skin_parts' (MapTag): which skin parts the player has enabled. The output map contains the following keys:
- 'cape' (ElementTag(Boolean)): whether the player's cape is enabled.
- 'hat' (ElementTag(Boolean)): whether the player's hat is enabled.
- 'jacket' (ElementTag(Boolean)): whether the player's jacket is enabled.
- 'left_sleeve' (ElementTag(Boolean)): whether the player's left sleeve is enabled.
- 'right_sleeve' (ElementTag(Boolean)): whether the player's right sleeve is enabled.
- 'left_pants' (ElementTag(Boolean)): whether the player's left pants is enabled.
- 'right_pants' (ElementTag(Boolean)): whether the player's right pants is enabled.
- 'text_filtering_enabled' (ElementTag(Boolean)): whether the player has text filtering enabled. Available only on MC 1.19+.
- 'view_distance' (ElementTag(Number)): the player's current view distance.
Generated Example
- foreach <player.client_options> key:key as:val:
    - narrate "<[key]> is set as <[val]>"
Grouppaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/properties/PaperPlayerExtensions.java#L33
Name<WorldTag.entities[(<matcher>)]>
ReturnsListTag(EntityTag)
DescriptionReturns a list of entities in this world.
Optionally specify an entity type matcher to filter down to.
Generated Example
- foreach <player.location.world.entities> as:entry:
    - narrate "found <[entry]>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/WorldTag.java#L254

Just Barely Matched Results



Command


NameChat
Syntaxchat [<text>] (no_target/targets:<entity>|...) (talkers:<entity>|...) (range:<#.#>)
Short DescriptionCauses an NPC/NPCs to send a chat message to nearby players.
Full DescriptionChat uses an NPC's speech controller provided by Denizen, typically inside 'interact' or 'task' script-containers.
Typically there is already player and NPC context inside a queue that is using the 'chat' command.
In this case, only a text input is required.
Alternatively, target entities can be specified to have any Entity chat to a different target/targets,
or specify 'no_target' to not send the message to any specific target.

Chat from an NPC is formatted by the settings present in Denizen's config.yml.
Players being chatted to see a slightly different message than surrounding players.
By default, a 'chat' will allow other players nearby to also see the conversation. For example:

- chat 'Hello!'

The player being chatted to, by default the attached Player to the script queue, will see a message 'Jack says to you, Hello!',
however surrounding entities will see something along the lines of 'Jack says to Bob, Hello!'.
The format for this is configurable via the "Denizen/config.yml" file.

If sending messages to the Player without any surrounding entities hearing the message is desirable,
it is often times recommended to instead use the 'narrate' command.
Alternatively, on a server-wide scale, the configuration node for the 'range' can be set to 0, however this is discouraged.
Related TagsNone
Usage Example
# Use to emulate an NPC talking out loud to a Player within an interact script-container.
- chat "Hello, <player.name>! Nice day, eh?"
Usage Example
# Use to have an NPC talk to a group of individuals.
- chat targets:<npc.location.find_players_within[6].filter[has_flag[clan_initiate]]> "Welcome, initiate!"
Synonyms (Search Aid)say, speak
Groupplayer
RequiresCitizens
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ChatCommand.java#L44
NameMobArena
Syntaxmobarena [<mobarena>] (add:<player>|...) (remove:<player>|...) (spectate:<player>|...)
Short DescriptionMake a player join, remove a player from or make a player spectate a MobArena.
Full DescriptionThis command allows you to make a player join an arena, make them leave an arena or make them spectate an arena.
Follows normal MobArena functionality, so acts as if the player has typed '/mobarena join'.
NOTE: You can use all 3: ("add", "remove", and "spectate") as once, however avoid conflicts.
Related Tags<player.mobarena.in_arena> Returns whether the player is in an arena.
Usage Example
# Use to force the player to join an arena.
- mobarena mobarena@Default add:<player>
Usage Example
# Use to force the player to leave an arena.
- mobarena mobarena@Default remove:<player>
Usage Example
# Use to force a player to join an arena and another to leave.
- mobarena mobarena@Default add:<player> remove:<[player]>
Usage Example
# Use to cause all players who aren't in an arena to spectate.
- mobarena mobarena@Default spectate:<server.online_players.filter[mobarena.in_arena.not]>
GroupDepenizen
RequiresDepenizen, MobArena
Sourcehttps://github.com/DenizenScript/Depenizen/blob/master/src/main/java/com/denizenscript/depenizen/bukkit/commands/mobarena/MobArenaCommand.java#L23