Denizen Script Meta Documentation Search


Learn about how Denizen works in The Beginner's Guide.
Showing 149 search results for inventory out of 3884 meta-documentation entries...

Perfect Name Match Results



Command


NameInventory
Syntaxinventory [open/close/copy/move/swap/set/keep/exclude/fill/clear/update/adjust <mechanism>:<value>/flag <name>(:<action>)[:<value>] (expire:<time>)] (destination:<inventory>) (origin:<inventory>/<item>|...) (slot:<slot>)
Short DescriptionEdits the inventory of a player, NPC, or chest.
Full DescriptionUse this command to edit the state of inventories.
By default, the destination inventory is the current attached player's inventory.

If you are copying, swapping, removing from (including via "keep" and "exclude"), adding to, moving, or filling inventories,
you'll need both destination and origin inventories.

Origin inventories may be specified as a list of ItemTags, but destinations must be actual InventoryTags.

Using "open", "clear", or "update" only require a destination.
"Update" also requires the destination to be a valid player inventory.

Using "close" closes any inventory that the currently attached player has opened.

The "adjust" option adjusts mechanisms on an item within a specific slot of an inventory (the "slot" parameter is required).
Note that this is only for items, it does NOT adjust the inventory itself. Use Command:adjust to adjust an inventory mechanism.

The "flag" option sets a flag on items, similar to Command:flag.
See also Language:flag system.

The "update" option will refresh the client's view of an inventory to match the server's view, which is useful to workaround some sync bugs.

Note that to add items to an inventory, you should usually use Command:give,
and to remove items from an inventory, you should usually use Command:take.

The slot argument can be any valid slot, see Language:Slot Inputs.
Related Tags<PlayerTag.inventory> Returns a InventoryTag of the player's current inventory. (...)
<PlayerTag.enderchest> Gets the player's enderchest inventory. (...)
<PlayerTag.open_inventory> Gets the inventory the player currently has open. If the player has no open (...)
<NPCTag.inventory> Returns the InventoryTag of the NPC.
<LocationTag.inventory> Returns the InventoryTag of the block at the location. If the (...)
Usage Example
# Use to open a chest inventory, at a location.
- inventory open d:<context.location>
Usage Example
# Use to open a virtual inventory with a title and some items.
- inventory open d:generic[size=27;title=BestInventory;contents=snowball|stick]
Usage Example
# Use to open another player's inventory.
- inventory open d:<[player].inventory>
Usage Example
# Use to remove all items from a chest, except any items in the specified list.
- inventory keep d:<context.location.inventory> o:snowball|ItemScript
Usage Example
# Use to remove all sticks and stones from the player's inventory.
- inventory exclude origin:stick|stone
Usage Example
# Use to clear the player's inventory entirely.
- inventory clear
Usage Example
# Use to swap two players' inventories.
- inventory swap d:<[playerOne].inventory> o:<[playerTwo].inventory>
Usage Example
# Use to adjust a specific item in the player's inventory.
- inventory adjust slot:5 "lore:Item modified!"
Usage Example
# Use to set a single stick into slot 10 of the player's inventory.
- inventory set o:stick slot:10
Usage Example
# Use to set a temporary flag on the player's held item.
- inventory flag slot:hand my_target:<player.cursor_on> expire:1d
Groupitem
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java#L95

Tag


Name<inventory[<inventory>]>
ReturnsInventoryTag
DescriptionReturns an inventory object constructed from the input value.
Refer to ObjectType:InventoryTag.
Generated Example
- inventory set o:<inventory[<player.inventory>]> d:stick slot:5
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/utilities/CommonRegistries.java#L228

Partial Name Match Results



Event


Nameinventory picks up item
Event Lines <inventory> picks up <item>
Triggerswhen a hopper or hopper minecart picks up an item.
Generated Examplesafter hopper picks up red_stained_glass:
on composter picks up lime_candle:
Contexts<context.inventory> returns the InventoryTag that picked up the item.
<context.item> returns the ItemTag.
<context.entity> returns a EntityTag of the item entity.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupItem
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/item/InventoryPicksUpItemScriptEvent.java#L14
Nameitem moves from inventory to inventory
Event Lines <item> moves from <inventory> (to <inventory>)
Triggerswhen an entity or block moves an item from one inventory to another. (Hopper-style movement, not player-induced movement).
Generated Exampleson trapped_chest moves from inventory:
after item moves from blast_furnace:
Contexts<context.origin> returns the origin InventoryTag.
<context.destination> returns the destination InventoryTag.
<context.initiator> returns the InventoryTag that initiated the item's transfer.
<context.item> returns the ItemTag that was moved.
DetermineItemTag to set a different item to be moved.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupItem
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/item/ItemMoveScriptEvent.java#L13
Nameplayer click_type clicks item in inventory
Event Lines player (<click_type>) clicks (<item>) in <inventory>
Triggerswhen a player clicks in an inventory. Note that you likely will also want to listen to Event:player drags in inventory.
Generated Examplesafter player click_type clicks in inventory:
on player clicks in enderchest:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switcheswith:<item> to only process the event if a specified cursor item was used.
in_area:<area> replaces the default 'in:<area>' for this event.
action:<action> to only process the event if a specified action occurred.
slot:<slot> to only process the event if a specified slot or slot_type was clicked. For slot input options, see Language:Slot Inputs.
Contexts<context.item> returns the ItemTag the player has clicked on.
<context.inventory> returns the InventoryTag (the 'top' inventory, regardless of which slot was clicked).
<context.clicked_inventory> returns the InventoryTag that was clicked in.
<context.cursor_item> returns the item the Player is clicking with.
<context.click> returns an ElementTag with the name of the click type. Click type list: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/ClickType.html
<context.slot_type> returns an ElementTag with the name of the slot type that was clicked. Slot type list: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryType.SlotType.html
<context.slot> returns an ElementTag with the number of the slot that was clicked.
<context.raw_slot> returns an ElementTag with the raw number of the slot that was clicked.
<context.is_shift_click> returns true if 'shift' was used while clicking.
<context.action> returns the inventory_action. See Language:Inventory Actions.
<context.hotbar_button> returns an ElementTag of the button pressed as a number, or 0 if no number button was pressed.
DetermineItemTag to set the current item for the event.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClicksInInventoryScriptEvent.java#L70
Nameplayer closes inventory
Event Lines player closes inventory
player closes <inventory>
Triggerswhen a player closes an inventory.
Generated Examplesafter player closes inventory:
after player closes dispenser:
after player closes shulker_box:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.inventory> returns the InventoryTag.
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClosesInvScriptEvent.java#L18
Nameplayer drags in inventory
Event Lines player drags in inventory
player drags (<item>) (in <inventory>)
Triggerswhen a player drags in an inventory (that is, clicks and then holds the mouse button down while moving the mouse across multiple slots).
Generated Examplesafter player drags in inventory:
on player drags item in furnace:
on player drags glass_bottle:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesin_area:<area> replaces the default 'in:<area>' for this event.
drag_type:<type> to only run the event if the given drag type (SINGLE or EVEN) was used.
Contexts<context.item> returns the ItemTag the player has dragged.
<context.inventory> returns the InventoryTag (the 'top' inventory, regardless of which slot was clicked).
<context.clicked_inventory> returns the InventoryTag that was clicked in.
<context.slots> returns a ListTag of the slot numbers dragged through.
<context.raw_slots> returns a ListTag of the raw slot numbers dragged through.
<context.drag_type> returns either SINGLE or EVEN depending on whether the player used their left or right mouse button.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerDragsInInvScriptEvent.java#L25
Nameplayer inventory slot changes
Event Lines player inventory slot changes
Triggerswhen the item in a slot of a player's inventory changes.
Note that this fires for every item in the player's inventory when they join.
Generated Examplesafter player inventory slot changes:
on player inventory slot changes:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesfrom:<item> to only process the event if the previous item in the slot matches the specified item.
to:<item> to only process the event if the new item in the slot matches the specified item.
slot:<slot> to only process the event if a specific slot was clicked. For slot input options, see Language:Slot Inputs.
Contexts<context.new_item> returns an ItemTag of the new item in the slot.
<context.old_item> returns an ItemTag of the previous item in the slot.
<context.slot> returns an ElementTag(Number) of the slot that was changed.
<context.raw_slot> returns an ElementTag(Number) of the raw number of the slot that was changed.
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/PlayerInventorySlotChangeScriptEvent.java#L16
Nameplayer opens inventory
Event Lines player opens inventory
player opens <inventory>
Triggerswhen a player opens an inventory. (EG, chests, not the player's main inventory.)
Generated Examplesafter player opens inventory:
after player opens entity:
after player opens cartography:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.inventory> returns the InventoryTag.
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerOpensInvScriptEvent.java#L16

Language


NameInventory Actions
DescriptionUsed by some inventory world events to describe the action of the inventory event.

Actions, as described by the bukkit javadocs:
CLONE_STACK
A max-size stack of the clicked item is put on the cursor.
COLLECT_TO_CURSOR
The inventory is searched for the same material, and they are put on the cursor up to
MaterialTag.max_stack_size.
DROP_ALL_CURSOR
The entire cursor item is dropped.
DROP_ALL_SLOT
The entire clicked slot is dropped.
DROP_ONE_CURSOR
One item is dropped from the cursor.
DROP_ONE_SLOT
One item is dropped from the clicked slot.
HOTBAR_MOVE_AND_READD
The clicked item is moved to the hotbar, and the item currently there is re-added to the
player's inventory.
HOTBAR_SWAP
The clicked slot and the picked hotbar slot are swapped.
MOVE_TO_OTHER_INVENTORY
The item is moved to the opposite inventory if a space is found.
NOTHING
Nothing will happen from the click.
PICKUP_ALL
All of the items on the clicked slot are moved to the cursor.
PICKUP_HALF
Half of the items on the clicked slot are moved to the cursor.
PICKUP_ONE
One of the items on the clicked slot are moved to the cursor.
PICKUP_SOME
Some of the items on the clicked slot are moved to the cursor.
PLACE_ALL
All of the items on the cursor are moved to the clicked slot.
PLACE_ONE
A single item from the cursor is moved to the clicked slot.
PLACE_SOME
Some of the items from the cursor are moved to the clicked slot (usually up to the max stack size).
SWAP_WITH_CURSOR
The clicked item and the cursor are exchanged.
UNKNOWN
An unrecognized ClickType.
GroupUseful Lists
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClicksInInventoryScriptEvent.java#L20
NameInventory Script Containers
DescriptionInventory script containers are an easy way to pre-define custom inventories for use within scripts.
Inventory scripts work with the InventoryTag object, and can be fetched with the Object Fetcher by using the
InventoryTag constructor InventoryTag_script_name.

Example: - inventory open d:MyInventoryScript

The following is the format for the container.

The 'inventory:' key is required, other keys vary based on the type.
Some types will require you define either 'size:' or 'slots:' (or both).
'Procedural items:' and 'definitions:' are optional, and should only be defined if needed.


# The name of the script is the same name that you can use to construct a new
# InventoryTag based on this inventory script. For example, an inventory script named 'Super_Cool_Inventory'
# can be referred to as 'Super_Cool_Inventory'.
Inventory_Script_Name:

    type: inventory

    # Must be a valid inventory type.
    # Valid inventory types: ANVIL, BREWING, CHEST, DISPENSER, ENCHANTING, ENDER_CHEST, HOPPER, WORKBENCH
    # | All inventory scripts MUST have this key!
    inventory: inventory type

    # The title can be anything you wish. Use color tags to make colored titles.
    # Note that titles only work for some inventory types, including ANVIL, CHEST, DISPENSER, FURNACE, ENCHANTING, HOPPER, WORKBENCH
    # | MOST inventory scripts should have this key!
    title: custom title

    # The size must be a multiple of 9. It is recommended to not go above 54, as it will not show correctly when a player looks into it.
    # | Some inventory scripts should have this key! Most can exclude it if 'slots' is used.
    size: 27

    # Set 'gui' to 'true' to indicate that the inventory is a GUI, meaning it's a set of buttons to be clicked, not a container of items.
    # This will prevent players from taking items out of or putting items into the inventory.
    # | SOME inventory scripts should have this key!
    gui: true

    # You can use definitions to define items to use in the slots. These are not like normal script definitions, and do not need to be in a definition tag.
    # | Some inventory scripts MAY have this key, but it is optional. Most scripts will just specify items directly.
    definitions:
        my item: ItemTag
        other item: ItemTag

    # Procedural items can be used to specify a list of ItemTags for the empty slots to be filled with.
    # Each item in the list represents the next available empty slot.
    # When the inventory has no more empty slots, it will discard any remaining items in the list.
    # A slot is considered empty when it has no value specified in the slots section.
    # If the slot is filled with air, it will no longer count as being empty.
    # | Most inventory scripts should exclude this key, but it may be useful in some cases.
    procedural items:
    - define list <list>
    - foreach <server.online_players>:
        # Insert some form of complex doesn't-fit-in-just-a-tag logic here
        - define item <[value].skull_item>
        - define list:->:<[item]>
    - determine <[list]>

    # You can specify the items in the slots of the inventory. For empty spaces, simply put an empty "slot" value, like "[]".
    # | Most inventory scripts SHOULD have this key!
    slots:
    - [] [] [] [my item] [ItemTag] [] [other item] [] []
    - [my item] [] [] [] [] [ItemTag] [ItemTag] [] []
    - [] [] [] [] [] [] [] [] [other item]
GroupScript Container System
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptContainer.java#L26

Mechanism


Nameinventory_contents
ObjectEntityTag
InputListTag(ItemTag)
Related Tags<EntityTag.inventory> Returns the entity's inventory, if it has one.
<InventoryTag.list_contents> Returns a list of all items in the inventory.
DescriptionClears the entity's inventory and sets it's item list to match the input.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInventory.java#L84
Nameanvil_max_repair_cost
ObjectInventoryTag
InputElementTag(Number)
Related Tags<InventoryTag.anvil_max_repair_cost> Returns the maximum repair cost on an anvil.
DescriptionSets the maximum repair cost of an anvil.
Generated Example
- adjust <player.inventory> anvil_max_repair_cost:2
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2494
Nameanvil_repair_cost
ObjectInventoryTag
InputElementTag(Number)
Related Tags<InventoryTag.anvil_repair_cost> Returns the current repair cost on an anvil.
DescriptionSets the current repair cost of an anvil.
Generated Example
- adjust <player.inventory> anvil_repair_cost:4
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2511
Namecontents
ObjectInventoryTag
InputListTag(ItemTag)
Related Tags<InventoryTag.list_contents> Returns a list of all items in the inventory.
<InventoryTag.list_contents.simple> Returns a list of all items in the inventory, without item properties.
<InventoryTag.list_contents.with_lore[<lore>]> Returns a list of all items in the inventory with the specified (...)
<InventoryTag.list_contents.with_lore[<lore>].simple> Returns a list of all items in the inventory with the specified (...)
DescriptionSets the contents of the inventory.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryContents.java#L185
Namefuel
ObjectInventoryTag
InputItemTag
Related Tags<InventoryTag.fuel> Returns the item currently in the fuel section of a furnace or brewing stand inventory.
DescriptionSets the item in the fuel slot of this furnace or brewing stand inventory.
Generated Example
- adjust <player.inventory> fuel:iron_sword
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2452
Nameinput
ObjectInventoryTag
InputItemTag
Related Tags<InventoryTag.input> Returns the item currently in the smelting slot of a furnace inventory, or the ingredient slot of a brewing stand inventory.
DescriptionSets the item in the smelting slot of a furnace inventory, or ingredient slot of a brewing stand inventory.
Generated Example
- adjust <player.inventory> input:iron_sword
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2473
Namematrix
ObjectInventoryTag
InputListTag(ItemTag)
Related Tags<InventoryTag.matrix> Returns the items currently in a crafting inventory's matrix.
DescriptionSets the items in the matrix slots of this crafting inventory.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2404
Namereformat
ObjectInventoryTag
InputElementTag
DescriptionReformats the contents of an inventory to ensure any items within will be stackable with new Denizen-produced items.
This is a simple handy cleanup tool that may sometimes be useful with Denizen updates.
This essentially just parses the item to Denizen text, back to an item, and replaces the slot.
Input can be "scripts" to only change items spawned by item scripts, or "all" to change ALL items.
Most users are recommended to only use "scripts".
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2528
Nameresult
ObjectInventoryTag
InputItemTag
Related Tags<InventoryTag.result> Returns the item currently in the result section of a crafting inventory or furnace inventory.
DescriptionSets the item in the result slot of this crafting inventory or furnace inventory.
Generated Example
- adjust <player.inventory> result:stick
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2428
Namesize
ObjectInventoryTag
InputElementTag(Number)
Related Tags<InventoryTag.size> (Property) Returns the size of the inventory. (...)
Description(Property) Sets the size of the inventory.
Note that the mechanism can only be set for "generic" chest inventories.
Generated Example
- adjust <player.inventory> size:4
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventorySize.java#L12
Nametitle
ObjectInventoryTag
InputElementTag
Related Tags<InventoryTag.title> (Property) Returns the title of the inventory. (...)
Description(Property) Sets the title of the inventory.
Note that the mechanism can only be set for "generic" inventories.
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryTitle.java#L14
Nametrades
ObjectInventoryTag
InputListTag(TradeTag)
Related Tags<InventoryTag.trades> (Property) Returns the trade recipe list for a merchant inventory.
Description(Property) Sets the trade recipe list for a merchant inventory.
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryTrades.java#L15
Nameinventory_contents
ObjectItemTag
InputListTag(ItemTag)
Related Tags<ItemTag.inventory_contents> (Property) A container item's inventory contents.
Description(Property) A container item's inventory contents.
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemInventoryContents.java#L28

ObjectType


NameInventoryTag
Prefixin@
Base TypeElementTag
ImplementsFlaggableObject, PropertyHolderObject
Identity FormatThe identity format for inventories is the classification type of inventory to use. All other data is specified through properties.
DescriptionAn InventoryTag represents an inventory, generically or attached to some in-the-world object.

Inventories can be generically designed using inventory script containers,
and can be modified using the inventory command.

Valid inventory type classifications:
"npc", "player", "crafting", "enderchest", "workbench", "entity", "location", "generic"

This object type can be noted.

This object type is flaggable when it is noted.
Flags on this object type will be stored in the notables.yml file.
MatchableInventoryTag matchers, sometimes identified as "<inventory>":
"inventory" plaintext: always matches.
"note" plaintext: matches if the inventory is noted.
Inventory script name: matches if the inventory comes from an inventory script of the given name, using advanced matchers.
Inventory note name: matches if the inventory is noted with the given name, using advanced matchers.
Inventory type: matches if the inventory is of a given type, using advanced matchers.
"inventory_flagged:<flag>": a Flag Matchable for InventoryTag flags.
"gui" plaintext: matches if the inventory is a GUI (see Language:inventory script containers).
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L59

Tag


Name<ElementTag.as_inventory>
ReturnsInventoryTag
DescriptionDeprecated in favor of Tag:ObjectTag.as
Generated Example
- inventory set o:<element[hello_world].as_inventory> d:stick slot:5
Groupconversion
Deprecateduse as[inventory]
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/bukkit/BukkitElementExtensions.java#L139
Name<EntityTag.inventory>
ReturnsInventoryTag
DescriptionReturns the entity's inventory, if it has one.
Generated Example
- note <player.inventory> as:my_new_inventory
Groupinventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityInventory.java#L61
Name<InventoryTag.anvil_max_repair_cost>
ReturnsElementTag(Number)
MechanismInventoryTag.anvil_max_repair_cost
DescriptionReturns the maximum repair cost on an anvil.
Generated Example
- narrate "the number value is <player.inventory.anvil_max_repair_cost>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2288
Name<InventoryTag.anvil_rename_text>
ReturnsElementTag
DescriptionReturns the current entered renaming text on an anvil.
Generated Example
- narrate <player.inventory.anvil_rename_text>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2302
Name<InventoryTag.anvil_repair_cost>
ReturnsElementTag(Number)
MechanismInventoryTag.anvil_repair_cost
DescriptionReturns the current repair cost on an anvil.
Generated Example
- narrate "the number value is <player.inventory.anvil_repair_cost>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2274
Name<InventoryTag.can_fit[<item>].count>
ReturnsElementTag(Number)
DescriptionReturns the total count of how many times an item can fit into an inventory.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1241
Name<InventoryTag.can_fit[<item>].quantity[<#>]>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory can fit a certain quantity of an item.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1260
Name<InventoryTag.can_fit[<item>|...]>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory can fit an item, or list of items.
When giving multiple item inputs, the tag will only return true if every item can be added to the inventory at once.
If only some fit, the tag will return false.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1213
Name<InventoryTag.contains_item[<matcher>].quantity[<#>]>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory contains a certain number of items that match the specified item matcher.
Uses the system behind Language:Advanced Object Matching.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1467
Name<InventoryTag.contains_item[<matcher>]>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory contains any item that matches the specified item matcher.
Uses the system behind Language:Advanced Object Matching.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1453
Name<InventoryTag.contains.display[(strict:)<element>].quantity[<#>]>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory contains a certain quantity of an item with the specified display name.
Use 'strict:' in front of the search element to ensure the display name is EXACTLY the search element,
otherwise the searching will only check if the search element is contained in the display name.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1516
Name<InventoryTag.contains.display[(strict:)<element>]>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory contains an item with the specified display name.
Use 'strict:' in front of the search element to ensure the display name is EXACTLY the search element,
otherwise the searching will only check if the search element is contained in the display name.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1493
Name<InventoryTag.contains.lore[(strict:)<element>|...].quantity[<#>]>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory contains a certain quantity of an item with the specified lore.
Use 'strict:' in front of the search elements to ensure all lore lines are EXACTLY the search elements,
otherwise the searching will only check if the search elements are contained in the lore.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1599
Name<InventoryTag.contains.lore[(strict:)<element>|...]>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory contains an item with the specified lore.
Use 'strict:' in front of the search elements to ensure all lore lines are EXACTLY the search elements,
otherwise the searching will only check if the search elements are contained in the lore.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1575
Name<InventoryTag.craftable_quantity>
ReturnsElementTag(Number)
DescriptionReturns the quantity of items that would be received if this crafting inventory were fully crafted (eg via a shift click).
Generated Example
- narrate "the number value is <player.inventory.craftable_quantity>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2230
Name<InventoryTag.empty_slots>
ReturnsElementTag(Number)
DescriptionReturns the number of empty slots in an inventory.
Generated Example
- narrate "the number value is <player.inventory.empty_slots>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1190
Name<InventoryTag.equipment_map>
ReturnsMapTag
DescriptionReturns a MapTag containing the inventory's equipment.
Output keys for players are boots, leggings, chestplate, helmet.
Output keys for horses are saddle, armor.
Air items will be left out of the map.
Generated Example
- foreach <player.inventory.equipment_map> key:key as:val:
    - narrate "<[key]> is set as <[val]>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2158
Name<InventoryTag.equipment>
ReturnsListTag(ItemTag)
DescriptionReturns the equipment of an inventory as a list of items.
For players, the order is boots|leggings|chestplate|helmet.
For horses, the order is saddle|armor.
Generated Example
- foreach <player.inventory.equipment> as:entry:
    - narrate "found <[entry]>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2171
Name<InventoryTag.exclude_item[<item_matcher>].quantity[<#>]>
ReturnsInventoryTag
DescriptionReturns the InventoryTag with a certain quantity of matching items excluded.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1354
Name<InventoryTag.exclude_item[<item_matcher>]>
ReturnsInventoryTag
DescriptionReturns a copy of the InventoryTag with all matching items excluded.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1331
Name<InventoryTag.find_all_items[<matcher>]>
ReturnsListTag
DescriptionReturns a list of the location of all slots that contains an item that matches the given item matcher.
Returns an empty list if there's no match.
Uses the system behind Language:Advanced Object Matching.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1887
Name<InventoryTag.find_empty_slots>
ReturnsListTag
DescriptionReturns the index of all the empty slots in an inventory.
Generated Example
- foreach <player.inventory.find_empty_slots> as:entry:
    - narrate "found <[entry]>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2366
Name<InventoryTag.find_item[<matcher>]>
ReturnsElementTag(Number)
DescriptionReturns the location of the first slot that contains an item that matches the given item matcher.
Returns -1 if there's no match.
Uses the system behind Language:Advanced Object Matching.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1863
Name<InventoryTag.first_empty>
ReturnsElementTag(Number)
DescriptionReturns the location of the first empty slot.
Returns -1 if the inventory is full.
Generated Example
- narrate "the number value is <player.inventory.first_empty>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1851
Name<InventoryTag.fuel>
ReturnsItemTag
MechanismInventoryTag.fuel
DescriptionReturns the item currently in the fuel section of a furnace or brewing stand inventory.
Generated Example
- give <player.inventory.fuel>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2315
Name<InventoryTag.id_holder>
ReturnsObjectTag
DescriptionReturns Denizen's holder ID for this inventory. (player object, location object, etc.)
Generated Example
- narrate "debug - the object is: <player.inventory.id_holder>"
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryHolder.java#L40
Name<InventoryTag.id_type>
ReturnsElementTag
DescriptionReturns Denizen's type ID for this inventory (player, location, etc.).
Generated Example
- narrate <player.inventory.id_type>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1991
Name<InventoryTag.include[<item>].quantity[<#>]>
ReturnsInventoryTag
DescriptionReturns the InventoryTag with a certain quantity of an item added.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1309
Name<InventoryTag.include[<item>|...]>
ReturnsInventoryTag
DescriptionReturns a copy of the InventoryTag with items added.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1287
Name<InventoryTag.input>
ReturnsItemTag
MechanismInventoryTag.input
DescriptionReturns the item currently in the smelting slot of a furnace inventory, or the ingredient slot of a brewing stand inventory.
Generated Example
- give <player.inventory.input>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2332
Name<InventoryTag.inventory_type>
ReturnsElementTag
DescriptionReturns the type of the inventory (e.g. "PLAYER", "CRAFTING", "HORSE").
Generated Example
- narrate <player.inventory.inventory_type>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2148
Name<InventoryTag.is_bossshop>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory is a BossShop.
Generated Example
- if <player.inventory.is_bossshop>:
    - narrate "it was true!"
- else:
    - narrate "it was false!"
RequiresDepenizen, BossShopPro
Sourcehttps://github.com/DenizenScript/Depenizen/blob/master/src/main/java/com/denizenscript/depenizen/bukkit/properties/bossshop/BossShopInventoryProperties.java#L60
Name<InventoryTag.is_empty>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory is empty.
Generated Example
- if <player.inventory.is_empty>:
    - narrate "it was true!"
- else:
    - narrate "it was false!"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1416
Name<InventoryTag.is_full>
ReturnsElementTag(Boolean)
DescriptionReturns whether the inventory is completely full.
Generated Example
- if <player.inventory.is_full>:
    - narrate "it was true!"
- else:
    - narrate "it was false!"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L1433
Name<InventoryTag.list_contents.simple>
ReturnsListTag(ItemTag)
MechanismInventoryTag.contents
DescriptionReturns a list of all items in the inventory, without item properties.
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryContents.java#L134
Name<InventoryTag.list_contents.with_lore[<element>].simple>
ReturnsListTag(ItemTag)
MechanismInventoryTag.contents
DescriptionReturns a list of all items in the inventory with the specified
lore, without item properties. Color codes are ignored.
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryContents.java#L165
Name<InventoryTag.list_contents.with_lore[<element>]>
ReturnsListTag(ItemTag)
MechanismInventoryTag.contents
DescriptionReturns a list of all items in the inventory with the specified
lore. Color codes are ignored.
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryContents.java#L147
Name<InventoryTag.list_contents>
ReturnsListTag(ItemTag)
MechanismInventoryTag.contents
DescriptionReturns a list of all items in the inventory.
Generated Example
- foreach <player.inventory.list_contents> as:entry:
    - narrate "found <[entry]>"
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryContents.java#L124
Name<InventoryTag.location>
ReturnsLocationTag
DescriptionReturns the location of this inventory's holder.
Generated Example
- teleport <player> <player.inventory.location>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2015
Name<InventoryTag.map_slots>
ReturnsMapTag
DescriptionReturns a map of inventory slots to the items in those slots (excludes air).
Generated Example
- foreach <player.inventory.map_slots> key:key as:val:
    - narrate "<[key]> is set as <[val]>"
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryContents.java#L105
Name<InventoryTag.matrix>
ReturnsListTag(ItemTag)
MechanismInventoryTag.matrix
DescriptionReturns the items currently in a crafting inventory's matrix.
Generated Example
- foreach <player.inventory.matrix> as:entry:
    - narrate "found <[entry]>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2183
Name<InventoryTag.note_name>
ReturnsElementTag
DescriptionGets the name of a noted InventoryTag. If the inventory isn't noted, this is null.
Generated Example
- narrate <player.inventory.note_name>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2001
Name<InventoryTag.quantity_item[(<matcher>)]>
ReturnsElementTag(Number)
DescriptionReturns the combined quantity of itemstacks that match an item matcher if one is specified,
or the combined quantity of all itemstacks if one is not.
Uses the system behind Language:Advanced Object Matching.
Generated Example
- narrate "the number value is <player.inventory.quantity_item>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2025
Name<InventoryTag.recipe>
ReturnsElementTag
DescriptionReturns the recipe ID for the recipe currently formed in a crafting inventory.
Returns a list in the Namespace:Key format, for example "minecraft:stick".
Generated Example
- narrate <player.inventory.recipe>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2206
Name<InventoryTag.result>
ReturnsItemTag
MechanismInventoryTag.result
DescriptionReturns the item currently in the result section of a crafting inventory or furnace inventory.
Generated Example
- give <player.inventory.result>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2250
Name<InventoryTag.script>
ReturnsScriptTag
DescriptionReturns the script that this inventory came from (if any).
Generated Example
- narrate <player.inventory.script>
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryHolder.java#L51
Name<InventoryTag.size>
ReturnsElementTag(Number)
MechanismInventoryTag.size
Description(Property) Returns the size of the inventory.
Note that the mechanism can only be set for "generic" chest inventories.
Generated Example
- narrate "the number value is <player.inventory.size>"
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventorySize.java#L12
Name<InventoryTag.slot[<#>|...]>
ReturnsObjectTag
DescriptionIf just a single slot is specified, returns the ItemTag in the specified slot.
If a list is specified, returns a ListTag(ItemTag) of the item in each given slot.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2096
Name<InventoryTag.stacks[(<item>)]>
ReturnsElementTag(Number)
DescriptionReturns the number of itemstacks that match an item if one is specified, or the number of all itemstacks if one is not.
Generated Example
- narrate "the number value is <player.inventory.stacks>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2081
Name<InventoryTag.title>
ReturnsElementTag
MechanismInventoryTag.title
Description(Property) Returns the title of the inventory.
Note that the mechanism can only be set for "generic" inventories.
Generated Example
- narrate <player.inventory.title>
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryTitle.java#L14
Name<InventoryTag.trades>
ReturnsListTag(TradeTag)
MechanismInventoryTag.trades
Description(Property) Returns the trade recipe list for a merchant inventory.
Generated Example
- foreach <player.inventory.trades> as:entry:
    - narrate "found <[entry]>"
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/inventory/InventoryTrades.java#L15
Name<InventoryTag.viewers>
ReturnsListTag(PlayerTag)
DescriptionReturns a list of players viewing the inventory.
Generated Example
- foreach <player.inventory.viewers> as:entry:
    - narrate "found <[entry]>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/InventoryTag.java#L2350
Name<ItemTag.has_inventory>
ReturnsElementTag(Boolean)
DescriptionReturns whether the item has an inventory.
If this returns true, it will enable access to:
Mechanism:ItemTag.inventory_contents, and Tag:ItemTag.inventory_contents.
Generated Example
- if <player.item_in_hand.has_inventory>:
    - narrate "it was true!"
- else:
    - narrate "it was false!"
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/ItemTag.java#L563
Name<ItemTag.inventory_contents>
ReturnsListTag(ItemTag)
MechanismItemTag.inventory_contents
Description(Property) A container item's inventory contents.
Generated Example
- foreach <player.item_in_hand.inventory_contents> as:entry:
    - narrate "found <[entry]>"
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemInventoryContents.java#L28
Name<LocationTag.has_inventory>
ReturnsElementTag(Boolean)
DescriptionReturns whether the block at the location has an inventory.
Generated Example
- if <player.location.has_inventory>:
    - narrate "it was true!"
- else:
    - narrate "it was false!"
Groupworld
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L1145
Name<LocationTag.inventory>
ReturnsInventoryTag
DescriptionReturns the InventoryTag of the block at the location. If the
block is not a container, returns null.
Generated Example
- inventory set o:<player.location.inventory> d:stick slot:5
Groupworld
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L1156
Name<NPCTag.inventory>
ReturnsInventoryTag
DescriptionReturns the InventoryTag of the NPC.
Generated Example
- inventory set o:<npc.inventory> d:stick slot:5
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/NPCTag.java#L917
Name<PlayerTag.inventory>
ReturnsInventoryTag
DescriptionReturns a InventoryTag of the player's current inventory.
Works with offline players.
Generated Example
- note <player.inventory> as:my_new_inventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java#L1508
Name<PlayerTag.open_inventory>
ReturnsInventoryTag
DescriptionGets the inventory the player currently has open. If the player has no open
inventory, this returns the player's inventory.
Generated Example
- note <player.open_inventory> as:my_new_inventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java#L1534

Partial Synonym Match Results


Name<FlaggableObject.flag_expiration[<flag_name>]>
ReturnsTimeTag
DescriptionReturns a TimeTag indicating when the specified flag will expire.
See Language:flag system.
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/flags/AbstractFlagTracker.java#L71
Name<FlaggableObject.flag_map[<name>|...]>
ReturnsMapTag
DescriptionReturns a raw map of the objects internal flag data for the flags with the given flag name. Names must be root names (no '.').
Output is a MapTag wherein each key is a flag name, and each value is a MapTag, containing keys '__value' and '__expiration', where '__value' contains the real object value.
Output also may contain key '__clear', which is a ListTag of flags that were listed in input but weren't present in output.
Using this without a parameter to get ALL flags is allowed exclusively for debug/testing reasons, and should never be used in a real script.
See Language:flag system.
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/flags/AbstractFlagTracker.java#L104
Name<FlaggableObject.flag[<flag_name>]>
ReturnsObjectTag
DescriptionReturns the specified flag from the flaggable object.
If the flag is expired, will return null.
Consider also using Tag:FlaggableObject.has_flag.
See Language:flag system.
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/flags/AbstractFlagTracker.java#L37
Name<FlaggableObject.has_flag[<flag_name>]>
ReturnsElementTag(Boolean)
DescriptionReturns true if the flaggable object has the specified flag, otherwise returns false.
See Language:flag system.
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/flags/AbstractFlagTracker.java#L55
Name<FlaggableObject.list_flags>
ReturnsListTag
DescriptionReturns a list of the flaggable object's flags.
Note that this is exclusively for debug/testing reasons, and should never be used in a real script.
See Language:flag system.
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/flags/AbstractFlagTracker.java#L87
Name<PropertyHolderObject.property_map>
ReturnsMapTag
DescriptionReturns the object's property map.
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/objects/properties/PropertyParser.java#L560
Name<PropertyHolderObject.supports[<property-name>]>
ReturnsElementTag(Boolean)
DescriptionReturns true if the property named is supported by the object.
This does not necessarily mean it has a valid current value, just that it's supported at all.
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/objects/properties/PropertyParser.java#L536
Name<PropertyHolderObject.with_map[<property-map>]>
ReturnsPropertyHolderObject
DescriptionReturns a copy of the object with the MapTag of mechanism adjustments applied.
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/objects/properties/PropertyParser.java#L513
Name<PropertyHolderObject.with_single[<mechanism>=<value>]>
ReturnsPropertyHolderObject
DescriptionReturns a copy of the object with a single mechanism adjustment applied.
This avoids the risk of escaping issues.
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/objects/properties/PropertyParser.java#L490
Name<PropertyHolderObject.with[<mechanism>=<value>;...]>
ReturnsPropertyHolderObject
DescriptionReturns a copy of the object with mechanism adjustments applied.
Be careful with dynamic inputs, they may break from escaping flaws.
Consider using Tag:PropertyHolderObject.with_single instead.
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/objects/properties/PropertyParser.java#L463

Strong Match Results


Name<EntityTag.equipment_map>
ReturnsMapTag
MechanismEntityTag.equipment
DescriptionReturns a MapTag containing the entity's equipment.
Output keys are boots, leggings, chestplate, helmet.
Air items will be left out of the map.
Generated Example
- foreach <player.equipment_map> key:key as:val:
    - narrate "<[key]> is set as <[val]>"
Groupinventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityEquipment.java#L93
Name<EntityTag.equipment>
ReturnsListTag(ItemTag)
MechanismEntityTag.equipment
DescriptionReturns a ListTag containing the entity's equipment.
Output list is boots|leggings|chestplate|helmet
Generated Example
- foreach <player.equipment> as:entry:
    - narrate "found <[entry]>"
Groupinventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityEquipment.java#L55
Name<EntityTag.has_saddle>
ReturnsElementTag(Boolean)
DescriptionIf the entity is a pig or horse, returns whether it has a saddle equipped.
Generated Example
- if <player.has_saddle>:
    - narrate "it was true!"
- else:
    - narrate "it was false!"
Groupinventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java#L1420
Name<EntityTag.horse_armor>
ReturnsItemTag
DescriptionIf the entity is a horse, returns the item equipped as the horses armor, or air if none.
Generated Example
- give <player.horse_armor>
Groupinventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java#L1406
Name<EntityTag.item_in_hand>
ReturnsItemTag
MechanismEntityTag.item_in_hand
DescriptionReturns the item the entity is holding, or air if none.
Generated Example
- give <player.item_in_hand>
Groupinventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityItemInHand.java#L69
Name<EntityTag.item_in_offhand>
ReturnsItemTag
MechanismEntityTag.item_in_offhand
DescriptionReturns the item the entity is holding in their off hand, or air if none.
Generated Example
- give <player.item_in_offhand>
Groupinventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityItemInOffHand.java#L69
Name<EntityTag.saddle>
ReturnsItemTag
DescriptionIf the entity is a horse or pig, returns the saddle as a ItemTag, or air if none.
Generated Example
- give <player.saddle>
Groupinventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java#L1389

Semi-Strong Match Results



Command


Namebossshop
Syntaxbossshop [<shop name>]
Short DescriptionOpens a BossShop inventory for a player.
Full DescriptionUse to open up a BossShop inventory for the linked player.
Useful for rewarding players using the BossShop plugin.
Shops are made with the BossShop system.
Related Tags<InventoryTag.is_bossshop> Returns whether the inventory is a BossShop.
Usage Example
# Use to open a bossshop inventory for the linked player.
- bossshop MyShop
GroupDepenizen
RequiresDepenizen, BossShopPro
Sourcehttps://github.com/DenizenScript/Depenizen/blob/master/src/main/java/com/denizenscript/depenizen/bukkit/commands/bossshop/BossShopCommand.java#L23
NameFakeItem
Syntaxfakeitem [<item>|...] [slot:<slot>] (duration:<duration>) (players:<player>|...) (raw)
Short DescriptionShow a fake item in a player's inventory.
Full DescriptionThis command allows you to display an item in an inventory that is not really there.

To make it automatically disappear at a specific time, use the 'duration:' argument.
Note that the reset can be unreliable, especially if the player changes their open inventory view. Consider using "- inventory update" after a delay instead.

By default, it will use any inventory the player currently has open.

Slots function as follows:
Player inventory is slots 1-36, same as normal inventory slot indices.
If the player has an open inventory, to apply the item to a slot in that inventory, add 36 to the slot index.
If the player does not have an open inventory, slots 36-40 are equipment, 41 is offhand, 42 is recipe result, 43-46 are recipe.

For modifying equipment, consider Mechanism:PlayerTag.fake_equipment instead.

The slot argument can be any valid slot, see Language:Slot Inputs.

Optionally specify 'raw' to indicate that the slow is a raw network slot ID.
Related TagsNone
Usage Example
# Use to show a clientside-only pumpkin on the player's head.
- fakeitem pumpkin slot:head
Groupitem
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/FakeItemCommand.java#L39
NameItemCooldown
Syntaxitemcooldown [<material>|...] (duration:<duration>)
Short DescriptionPlaces a cooldown on a material in a player's inventory.
Full DescriptionPlaces a cooldown on a material in a player's inventory.
Related Tags<PlayerTag.item_cooldown[<material>]> Returns the cooldown duration remaining on player's material.
Usage Example
# Places a 1 second cooldown on using an ender pearl.
- itemcooldown ender_pearl
Usage Example
# Places a 10 minute cooldown on using golden apples.
- itemcooldown golden_apple d:10m
Groupplayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ItemCooldownCommand.java#L26
NameOpenTrades
Syntaxopentrades [<entity>/<trade>|...] (title:<title>) (players:<player>|...)
Short DescriptionOpens the specified villager entity's trading inventory or a list of trades.
Full DescriptionForces a player to open a villager's trading inventory or a virtual trading inventory.
If an entity is specified, only one player can be specified.
Otherwise, if a list of trades is specified, more than one player can be specified.
If the title is not specified, no title will be applied to the virtual trading inventory.
If no player is specified, by default the attached player will be forced to trade.
Related Tags<PlayerTag.selected_trade_index> Returns the index of the trade the player is currently viewing, if any.
<EntityTag.is_trading> Returns whether the villager entity is trading.
<EntityTag.trades> Returns a list of the Villager's trade recipes.
<EntityTag.trading_with> Returns the player who is trading with the villager entity, or null if it is not trading.
Usage Example
# Use to open an unusable trade.
- opentrades trade
Usage Example
# Use to open a list of trades with an optional title.
- opentrades trade[result=stone;inputs=stone;max_uses=9999]|trade[inputs=barrier;result=barrier] "title:Useless Trades"
Usage Example
# Use to force a player to trade with a villager.
- opentrades <[villager_entity]>
Groupplayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java#L31

Event


Nameplayer mends item
Event Lines player mends item
player mends <item>
Triggerswhen an XP orb is used to repair an item with the Mending enchantment in the player's inventory.
Generated Exampleson player mends item:
on player mends brown_glazed_terracotta:
after player mends item:
after player mends warped_sign:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.item> returns the item that is repaired.
<context.repair_amount> returns how much durability the item recovers.
<context.xp_orb> returns the XP orb that triggered the event.
<context.slot> returns the slot of the item that has been repaired. This value is a bit of a hack and is not reliable.
DetermineElementTag(Number) to set the amount of durability the item recovers.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerMendsItemScriptEvent.java#L18

Language


NameVirtual Inventories
DescriptionVirtual inventories are inventories that have no attachment to anything within the world of Minecraft.
They can be used for a wide range of purposes - from looting fallen enemies to serving as interactive menus with item 'buttons'.

In Denizen, all noted inventories (saved by the Note command) are automatically converted into a virtual copy of the saved inventory.
This enables you to open and edit the items inside freely, with automatic saving, as if it were a normal inventory.

Noting is not the only way to create virtual inventories, however.
Using 'generic' along with inventory properties will allow you to create temporary custom inventories to do with as you please.
The properties that can be used like this are:

size=<size>
contents=<item>|...
title=<title>
holder=<inventory type>

For example, the following task script opens a virtual inventory with 18 slots,
where the second slot is a snowball, all the rest are empty, and the title is "My Awesome Inventory" with some colors in it.

open random inventory:
  type: task
  script:
  - inventory open "d:generic[size=18;title=<red>My <green>Awesome <blue>Inventory;contents=air|snowball]"
GroupInventory System
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java#L65

Semi-Decent Match Results



Command


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
NameGive
Syntaxgive [<item>|...] (quantity:<#>) (unlimit_stack_size) (to:<inventory>) (slot:<slot>) (allowed_slots:<slot-matcher>) (ignore_leftovers)
Short DescriptionGives the player an item or xp.
Full DescriptionGives the linked player items.

Optionally specify a slot to put the items into. If the slot is already filled, the next available slot will be used.
If the inventory is full, the items will be dropped on the ground at the inventory's location.
For player inventories, only the storage contents are valid - to equip armor or an offhand item, use Command:equip.

Specifying "unlimit_stack_size" will allow an item to stack up to 64. This is useful for stacking items
with a max stack size that is less than 64 (for example, most weapon and armor items have a stack size of 1).

When giving an item, you can specify any valid inventory as a target. If unspecified, the linked player's inventory will be used.
You may optionally specify a "slot" as any valid slot input per Language:Slot Inputs to be the starting slot index.
You may optionally specify "allowed_slots" to forcibly restrict the item to only be given to certain specific slots that match a slot-matcher.
You may optionally specify "ignore_leftovers" to cause leftover items to be ignored. If not specified, leftover items will be dropped.

To give xp to a player, use Command:experience.
To give money to a player, use Command:money.
Related Tags<PlayerTag.inventory> Returns a InventoryTag of the player's current inventory. (...)
<entry[saveName].leftover_items> returns a ListTag of any item(s) that didn't fit into the inventory.
Usage Example
# Use to give an item to the player.
- give iron_sword
Usage Example
# Use to give an item and place it in a specific slot if possible.
- give WATCH slot:5
Usage Example
# Use to give an item to some other defined player.
- give diamond player:<[target]>
Groupitem
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java#L31
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>]> Deprecated in favor of Tag:util.notes
<CuboidTag.note_name> Gets the name of a noted CuboidTag. If the cuboid isn't noted, this is null.
<EllipsoidTag.note_name> Gets the name of a noted EllipsoidTag. If the ellipsoid isn't noted, this is null.
<PolygonTag.note_name> Gets the name of a noted PolygonTag. If the polygon isn't noted, this is null.
<InventoryTag.note_name> Gets the name of a noted InventoryTag. If the inventory isn't noted, this is null.
<LocationTag.note_name> Gets the name of a noted LocationTag. If the location isn't noted, this is null.
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
NameTake
Syntaxtake [iteminhand/cursoritem/bydisplay:<name>/bycover:<title>|<author>/slot:<slot>/flagged:<flag>/item:<matcher>] (quantity:<#>) (from:<inventory>)
Short DescriptionTakes an item from the player.
Full DescriptionTakes items from a player or inventory.

If the player or inventory does not have the item being taken, nothing happens.

Using 'slot:' will take the items from that specific slot.

Using 'flagged:' with a flag name will take items with the specified flag name, see Language:flag system.

Using 'iteminhand' will take from the player's held item slot.

Using 'cursoritem' will take from the player's held cursor item (as in, one that's actively being picked up and moved in an inventory screen).

Using 'bydisplay:' will take items with the specified display name.

Using 'bycover:' will take a written book by the specified book title + author pair.

Using 'raw_exact:' (Intentionally undocumented) will compare all raw details of an item exactly. This is almost always a bad idea to use. DO NOT USE.

Using 'item:' will take items that match an advanced item matcher, using the system behind Language:Advanced Object Matching.

Flagged, Slot, ByDisplay, and Raw_Exact, all take a list as input to take multiple different item types at once.

If no quantity is specified, exactly 1 item will be taken.

Specifying a raw item without any matching method is considered unreliable and should be avoided.

Optionally using 'from:' to specify a specific inventory to take from. If not specified, the linked player's inventory will be used.

The options 'iteminhand' and 'cursoritem' require a linked player and will ignore the 'from:' inventory.

To take xp from a player, use Command:experience.
To take money from a player, use Command:money.
Related Tags<PlayerTag.item_in_hand> Returns the item the entity is holding, or air if none.
Usage Example
# Use to take an arrow from the player's enderchest
- take item:arrow from:<player.enderchest>
Usage Example
# Use to take the current holding item from the player's hand
- take iteminhand
Usage Example
# Use to take 5 emeralds from the player's inventory
- take item:emerald quantity:5
Groupitem
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/TakeCommand.java#L41
NameTeleport
Syntaxteleport (<entity>|...) [<location>] (cause:<cause>) (entity_options:<option>|...) (relative) (relative_axes:<axis>|...) (offthread_repeat:<#>) (offthread_yaw) (offthread_pitch)
Short DescriptionTeleports the entity(s) to a new location.
Full DescriptionTeleports the entity or entities to the new location.
Entities can be teleported between worlds using this command.
You may optionally specify a teleport cause for player entities, allowing proper teleport event handling. When not specified, this is "PLUGIN". See Language:teleport cause for causes.

Instead of a valid entity, an unspawned NPC or an offline player may also be used.

Optionally specify "relative" to use relative teleportation (Paper only). This is primarily useful only for players, but available for all entities.
Relative teleports are smoother for the client when teleporting over short distances.
Optionally, you may use "relative_axes:" to specify a set of axes to move relative on (and other axes will be treated as absolute), as any of "X", "Y", "Z", "YAW", "PITCH".
Optionally, you may use "offthread_repeat:" with the relative arg when teleporting a player to smooth out the teleport with a specified number of extra async packets sent within a single tick.
Optionally, specify "offthread_yaw" or "offthread_pitch" while using offthread_repeat to smooth the player's yaw/pitch to the new location's yaw/pitch.

Optionally, specify additional teleport options using the 'entity_options:' arguments (Paper only).
This allows things like retaining an open inventory when teleporting - see the links below for more information.
See 🔗https://jd.papermc.io/paper/1.19/io/papermc/paper/entity/TeleportFlag.EntityState.html for all possible options.
Note that the API this is based on is marked as experimental in Paper, and so may change in the future.
Related Tags<EntityTag.location> Returns the location of the entity. (...)
Usage Example
# Use to teleport a player to the location their cursor is pointing at.
- teleport <player> <player.cursor_on>
Usage Example
# Use to teleport a player high above.
- teleport <player> <player.location.above[200]>
Usage Example
# Use to teleport to a random online player.
- teleport <player> <server.online_players.random.location>
Usage Example
# Use to teleport all players to your location.
- teleport <server.online_players> <player.location>
Usage Example
# Use to teleport the NPC to a location that was noted with the <@link command note> command.
- teleport <npc> my_prenoted_location
Usage Example
# Use to teleport a player to some location, and inform events that it was caused by a nether portal.
- teleport <player> <server.flag[nether_hub_location]> cause:nether_portal
Usage Example
# Use to teleport the player without closing their currently open inventory.
- teleport <player> <player.location.below[5]> entity_options:retain_open_inventory
Synonyms (Search Aid)tp
Groupentity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/TeleportCommand.java#L39

Event


Nameentity dies|death
Event Lines <entity> dies|death
Triggerswhen an entity dies. Note that this fires *after* the entity dies, and thus some data may be lost from the entity.
The death can only be cancelled on Paper.
Generated Exampleson entity dies:
after entity dies:
Has Playerwhen the entity that died is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Has NPCwhen the entity that died is an NPC.
Switchesby:<entity> to only process the event if the killer is known and matches the specified entity matcher.
cause:<cause> to only process the event if it was caused by a specific damage cause.
Contexts<context.entity> returns the EntityTag that died.
<context.damager> returns the EntityTag damaging the other entity, if any.
<context.projectile> returns the EntityTag of a projectile used to kill the entity, if one was used.
<context.message> returns an ElementTag of a player's death message.
<context.cause> returns an ElementTag of the cause of the death. See Language:damage cause for a list of possible damage causes.
<context.drops> returns a ListTag of all pending item drops.
<context.xp> returns an ElementTag of the amount of experience to be dropped.
<context.keep_inventory> returns true if the player dying is set to keep their inventory, false if not, or null if the dying entity is not a player.
DetermineElementTag to change the death message.
"NO_DROPS" to specify that any drops should be removed.
"NO_XP" to specify that any XP orbs should be removed.
ListTag(ItemTag) to specify new items to be dropped.
ElementTag(Number) to specify the new amount of XP to be dropped.
"KEEP_INV" to specify (if a player death) that the inventory should be kept.
"KEEP_LEVEL" to specify (if a player death) that the XP level should be kept.
"NO_MESSAGE" to hide a player death message.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupEntity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java#L27
Nameentity loads crossbow
Event Lines <entity> loads crossbow
Triggerswhen a living entity loads a crossbow with a projectile.
Generated Exampleson entity loads crossbow:
after cow loads crossbow:
Has Playerwhen the entity is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Has NPCwhen the entity is an NPC.
Switchescrossbow:<item> to only process the event if the crossbow is a specified item.
Contexts<context.entity> returns the EntityTag that is loading the crossbow.
<context.crossbow> returns the ItemTag of the crossbow.
<context.consumes> returns true if the loading will consume a projectile item, otherwise false.
<context.hand> returns "HAND" or "OFF_HAND" depending on which hand is holding the crossbow item.
Determine"KEEP_ITEM" to keep the projectile item in the shooter's inventory.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/EntityLoadCrossbowScriptEvent.java#L17
Nameitem enchanted
Event Lines <item> enchanted
Triggerswhen an item is enchanted.
Generated Exampleson glass enchanted:
on item enchanted:
Has Playerwhen the enchanter is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesenchant:<name> to only process the event if any of the enchantments being added match the given name.
Contexts<context.entity> returns the EntityTag of the enchanter (if applicable)
<context.location> returns the LocationTag of the enchanting table.
<context.inventory> returns the InventoryTag of the enchanting table.
<context.item> returns the ItemTag to be enchanted.
<context.button> returns which button was pressed to initiate the enchanting.
<context.cost> returns the experience level cost of the enchantment.
<context.enchants> returns a MapTag of enchantment names to the level that will be applied.
DetermineElementTag(Number) to set the experience level cost of the enchantment.
"RESULT:<ItemTag>" to change the item result (only affects metadata (like enchantments), not material/quantity/etc!).
"ENCHANTS:<MapTag>" to change the resultant enchantments.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupItem
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/item/ItemEnchantedScriptEvent.java#L22
Nameitem recipe formed
Event Lines <item> recipe formed
Triggerswhen an item's recipe is correctly formed.
Generated Examplesafter beetroot_soup recipe formed:
after red_concrete recipe formed:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.inventory> returns the InventoryTag of the crafting inventory.
<context.item> returns the ItemTag to be formed in the result slot.
<context.recipe> returns a ListTag of ItemTags in the recipe.
<context.recipe_id> returns the ID of the recipe that was formed.
<context.is_repair> returns an ElementTag(Boolean) of whether the event was triggered by a tool repair operation rather than a crafting recipe.
DetermineItemTag to change the item that is formed in the result slot.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
GroupItem
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/item/ItemRecipeFormedScriptEvent.java#L23
Nameanvil block damaged|breaks
Event Lines anvil block damaged|breaks
Triggerswhen an anvil is damaged from being used.
Generated Exampleson anvil block breaks:
after anvil block damaged:
Switchesstate:<state> to only process the event if the anvil's new damage state matches the specified state.
Contexts<context.state> returns an ElementTag of the anvil's new damage state. Refer to 🔗https://jd.papermc.io/paper/1.19/com/destroystokyo/paper/event/block/AnvilDamagedEvent.DamageState.html.
<context.break> returns an ElementTag(Boolean) that signifies whether the anvil will break.
<context.inventory> returns the InventoryTag of the anvil's inventory.
Determine"STATE:<ElementTag>" to set the anvil's new damage state.
"BREAK:<ElementTag(Boolean)>" to set weather the anvil will break.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/AnvilBlockDamagedScriptEvent.java#L17
Namebrewing stand brews
Event Lines brewing stand brews
Triggerswhen a brewing stand brews a potion.
Generated Examplesafter brewing stand brews:
Contexts<context.location> returns the LocationTag of the brewing stand.
<context.inventory> returns the InventoryTag of the brewing stand's contents.
<context.fuel_level> returns an ElementTag(Number) of the brewing stand's fuel level.
<context.result> returns a ListTag(ItemTag) of the items that will be brewed.
Determine"RESULT:<ListTag(ItemTag)>" to change the items that are brewed.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupBlock
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/block/BrewsScriptEvent.java#L16
Nameloot generates
Event Lines loot generates
Triggerswhen loot is generated somewhere in the world (like a vanilla chest being opened for the first time).
Generated Exampleson loot generates:
after loot generates:
Has Playerwhen the linked entity is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesfor:<type> to only process the event if a certain inventory type is receiving loot (like 'for:chest').
Contexts<context.entity> returns an entity that caused loot generation, if any.
<context.inventory> returns the InventoryTag that loot is generating into.
<context.items> returns a ListTag of the items being generated.
<context.loot_table_id> returns an element indicating the minecraft key for the loot-table that was generated.
Determine"LOOT:<ListTag(ItemTag)>" to change the list of items that will generate as loot.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupWorld
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/world/LootGenerateScriptEvent.java#L22
Nameplayer changes armor stand item
Event Lines player changes armor stand item
Triggerswhen a player modifies an armor stand entity.
Generated Examplesafter player changes armor stand item:
on player changes armor stand item:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesfrom:<item> to only process the event if the item on the armor stand being interacted with matches the specified item matcher.
hand:<hand> to only process the event if the player is using a specific hand to interact with the armor stand. Available only on MC versions 1.19+.
to:<item> to only process the event if the item held by the player matches the specified item matcher.
slot:<slot> to only process the event if the armor stand's item slot that was interacted with is the specified slot.
armor_stand:<entity> to only process the event if the armor stand being interacted with matches the specified entity matcher.
Contexts<context.armor_stand_item> returns the ItemTag being interacted with on the armor stand.
<context.entity> returns an EntityTag of the armor stand.
<context.hand> returns an ElementTag of the hand used by the player to interact with the armor stand, can be either HAND or OFF_HAND. Available only on MC versions 1.19+.
<context.player_item> returns the ItemTag held by the player.
<context.slot> returns an ElementTag of the armor stand's item slot that was interacted with. Valid equipment slot values can be found at 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/EquipmentSlot.html.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerArmorStandManipulateScriptEvent.java#L18
Nameplayer crafts item
Event Lines player crafts item
player crafts <item>
Triggerswhen a player fully crafts an item.
Generated Examplesafter player crafts item:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.inventory> returns the InventoryTag of the crafting inventory.
<context.item> returns the ItemTag to be crafted.
<context.amount> returns the amount of the item that will be crafted (usually 1, except when shift clicked. Can be above 64).
<context.recipe> returns a ListTag of ItemTags in the recipe.
<context.recipe_id> returns the ID of the recipe that is being crafted.
<context.click_type> returns an ElementTag with the name of the click type. Click type list: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/ClickType.html
DetermineItemTag to change the item that is crafted.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerCraftsItemScriptEvent.java#L25
Nameplayer prepares anvil craft item
Event Lines player prepares anvil craft item
player prepares anvil craft <item>
Triggerswhen a player prepares an anvil to craft an item.
Generated Examplesafter player prepares anvil craft item:
on player prepares anvil craft hoglin_spawn_egg:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.inventory> returns the InventoryTag of the anvil inventory.
<context.item> returns the ItemTag to be crafted.
<context.repair_cost> returns an ElementTag(Number) of the repair cost.
<context.new_name> returns an ElementTag of the new name.
DetermineElementTag(Number) to set the repair cost.
ItemTag to change the item that is crafted.
GroupPlayer
Warning(s)The player doing the crafting is estimated and may be inaccurate.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPreparesAnvilCraftScriptEvent.java#L19
Nameplayer prepares grindstone craft item
Event Lines player prepares grindstone craft <item>
Triggerswhen a player prepares to grind an item.
Example
# This example removes the usually not removable curse of binding enchantment.
on player prepares grindstone craft item:
- determine result:<context.result.with[remove_enchantments=binding_curse]>
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.inventory> returns the InventoryTag of the grindstone inventory.
<context.result> returns the ItemTag to be crafted.
Determine"RESULT:<ItemTag>" to change the item that is crafted.
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
RequiresPaper
Warning(s)The player doing the grinding is estimated and may be inaccurate.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/PlayerPreparesGrindstoneCraftScriptEvent.java#L18
Nameplayer prepares smithing item
Event Lines player prepares smithing item
player prepares smithing <item>
Triggerswhen a player prepares to upgrade an item on a smithing table.
Generated Exampleson player prepares smithing item:
on player prepares smithing red_glazed_terracotta:
after player prepares smithing item:
after player prepares smithing glistering_melon_slice:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.inventory> returns the InventoryTag of the smithing table inventory.
<context.item> returns the ItemTag after upgrading.
DetermineItemTag to change the item that results from the upgrade.
GroupPlayer
Warning(s)The player doing the smithing is estimated and may be inaccurate.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayersPrepareSmithingTableScriptEvent.java#L18
Nameplayer scrolls their hotbar
Event Lines player scrolls their hotbar
player holds item
Triggerswhen a player scrolls through their hotbar.
Generated Examplesafter player scrolls their hotbar:
after player holds item:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesitem:<item> to only process the event when the player is going to hold a specified item.
Contexts<context.new_slot> returns the number of the new inventory slot.
<context.previous_slot> returns the number of the old inventory slot.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/HotbarScrollScriptEvent.java#L15
Nameplayer selects loom pattern
Event Lines player selects loom pattern
Triggerswhen a player selects a loom pattern.
Example
# Announce the player's selected loom pattern.
on player selects loom pattern:
- announce "<player.name> selected the <context.pattern> pattern!"
Example
# If the player selects the "CREEPER" pattern type, publicly shames them before setting the pattern to "SKULL".
on player selects loom pattern type:CREEPER:
- announce "Shame on <player.name> for selecting the creeper pattern!"
- determine pattern:SKULL
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchestype:<pattern> to only process the event if the specified pattern is selected.
Contexts<context.loom> returns an InventoryTag of the loom.
<context.pattern> returns an ElementTag of the selected pattern. Valid pattern types can be found at: 🔗https://jd.papermc.io/paper/1.19/org/bukkit/block/banner/PatternType.html
Determine"PATTERN:<ElementTag>" to set the pattern type of the loom.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/PlayerLoomPatternSelectScriptEvent.java#L18
Nameplayer selects stonecutter recipe
Event Lines player selects stonecutter recipe
Triggerswhen a player selects a recipe in a stonecutter.
Generated Exampleson player selects stonecutter recipe:
after player selects stonecutter recipe:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesrecipe_id:<recipe_id> to only process the event if the recipe matches the recipe ID.
Contexts<context.inventory> returns the InventoryTag of the stonecutter inventory.
<context.input> returns an ItemTag of the item in the input slot.
<context.result> returns an ItemTag of the item in the result slot.
<context.recipe_id> returns the ID of the recipe that was selected.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/PlayerSelectsStonecutterRecipeScriptEvent.java#L16
Nameplayer smiths item
Event Lines player smiths item
player smiths <item>
Triggerswhen a player upgrades an item on a smithing table.
Generated Examplesafter player smiths item:
on player smiths spruce_leaves:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.inventory> returns the InventoryTag of the smithing table inventory.
<context.item> returns the ItemTag after upgrading.
DetermineItemTag to change the item that results from the upgrade.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerSmithsItemScriptEvent.java#L19

Language


NameAttribute Modifiers
DescriptionIn minecraft, the "attributes" system defined certain core numerical values on entities, such as max health or attack damage.
The value of an "attribute" is determined by its "base value" modified mathematically by each of its "attribute modififers".
"Attribute modifiers" can be added either directly to the entity, or onto items - when on an item, an entity can equip it into the correct slot to automatically apply the modifier.

These can be read via such tags as Tag:EntityTag.attribute_modifiers, Tag:ItemTag.attribute_modifiers,
Tag:EntityTag.has_attribute, Tag:EntityTag.attribute_value, Tag:EntityTag.attribute_base_value, Tag:EntityTag.attribute_default_value, ...

These can be modified by such mechanisms as Mechanism:EntityTag.attribute_base_values, Mechanism:EntityTag.attribute_modifiers, Mechanism:EntityTag.add_attribute_modifiers,
Mechanism:EntityTag.remove_attribute_modifiers, Mechanism:ItemTag.attribute_modifiers, Mechanism:ItemTag.add_attribute_modifiers, Mechanism:ItemTag.remove_attribute_modifiers, ...

The input format of each of the 'add' and set mechanisms is slightly complicated: a MapTag where the keys are attribute names, and values are a ListTag of modifiers,
where each modifier is itself a MapTag with required keys 'operation' and 'amount', and additionally:
Before MC 1.21: optional 'name', 'slot', and 'id' keys.
The default ID will be randomly generated, the default name will be the attribute name.
After MC 1.21: required 'key' key, and optional 'slot'.
The 'key' is the attribute's name/identifier in a "namespace:key" format (defaulting to the "minecraft" namespace), which has to be distinct to other modifiers of the same type on the object.

Valid operations: ADD_NUMBER, ADD_SCALAR, and MULTIPLY_SCALAR_1
Valid slots (used up to MC 1.20.6): HAND, OFF_HAND, FEET, LEGS, CHEST, HEAD, ANY
Valid slot groups (used on MC 1.20.6+): 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/EquipmentSlotGroup.html
Valid attribute names are listed at 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html
The default slot/slot group is "any".

Operation names are based on the Bukkit enum.
ADD_NUMBER corresponds to Mojang "ADDITION" - adds on top of the base value.
ADD_SCALAR corresponds to Mojang "MULTIPLY_BASE" - adds to the total, multiplied by the base value.
MULTIPLY_SCALAR_1 corresponds to Mojang "MULTIPLY_TOTAL", multiplies the final value (after both "add_number" and "add_scaler") by the amount given plus one.

They are combined like (pseudo-code):

- define x <[base_value]>
- foreach <all_modifiers[ADD_NUMBER]>:
    - define x:+:<[value]>
- define y <[x]>
- foreach <all_modifiers[ADD_SCALAR]>:
    - define y:+:<[x].mul[<[value]>]>
- foreach <all_modifiers[MULTIPLY_SCALAR_1]>:
    - define y:*:<[value].add[1]>
- determine <[y]>


See also 🔗https://minecraft.wiki/w/Attribute#Modifiers

For a quick and dirty in-line input, you can do for example: [generic_max_health=<list[<map[key=my_project:add_health;operation=ADD_NUMBER;amount=20;slot=HEAD]>]>]

For more clean/proper input, instead do something like:

- definemap attributes:
    generic_max_health:
        1:
            key: my_project:add_health
            operation: ADD_NUMBER
            amount: 20
            slot: head
- inventory adjust slot:head add_attribute_modifiers:<[attributes]>


When pre-defining a custom item, instead of this, simply use an item script: Language:item script containers. That page shows an example of valid attribute modifiers on an item script.
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityAttributeModifiers.java#L208
NameFlag System
DescriptionThe flag system is a core feature of Denizen, that allows for persistent data storage linked to objects.

"Persistent" means the data is still around even after a server restart or anything else, and is only removed when you choose for it to be removed.
"Linked to objects" means rather than purely global values, flags are associated with a player, or an NPC, or a block, or whatever else.

See also the guide page at 🔗https://guide.denizenscript.com/guides/basics/flags.html.

For non-persistent temporary memory, see instead Command:define.
For more generic memory options, see Command:yaml or Command:sql.

Flags can be sub-mapped with the '.' character, meaning a flag named 'x.y.z' is actually a flag 'x' as a MapTag with key 'y' as a MapTag with key 'z' as the final flag value.
In other words, "<server.flag[a.b.c]>" is equivalent to "<server.flag[a].get[b].get[c]>"

Server flags can be set by specifying 'server' as the object, essentially a global flag target, that will store data in the file "plugins/Denizen/server_flags.dat"

Most unique object types are flaggable - refer to any given object type's language documentation for details.

Most flag sets are handled by Command:flag, however items are primarily flagged via Command:inventory with the 'flag' argument.
Any supported object type, including the 'server' base tag, can use the tags
Tag:FlaggableObject.flag, Tag:FlaggableObject.has_flag, Tag:FlaggableObject.flag_expiration, Tag:FlaggableObject.list_flags.

Additionally, flags be searched for with tags like Tag:server.online_players_flagged, Tag:server.players_flagged, Tag:server.spawned_npcs_flagged, Tag:server.npcs_flagged, ...
Flags can also be required by script event lines, as explained at Language:Script Event Switches.
Item flags can also be used as a requirement in Command:take.

Note that some internal flags exist, and are prefixed with '__' to avoid conflict with normal user flags.
This includes:
- '__raw' and '__clear' which are part of a fake-flag system used for forcibly setting raw data to a flaggable object,
- '__scripts', '__time', etc. which is where some object-type flags are stored inside of server flags,
- '__interact_step' which is used for interact script steps, related to Command:zap,
- '__interact_cooldown' which is used for interact script cooldowns, related to Command:cooldown.

Flags have an expiration system, which is used by specifying a time at which they should expire (or via a duration which internally calculates the date/time of expiration by adding the duration input to the current date/time).
Expirations are then *checked for* in flag tags - meaning, the flag tags will internally compare a stored date/time against the real current date/time,
and if the flag's expiration time is in the past, the flag tag will return values equivalent to if the flag doesn't exist.
There is no system actively monitoring for flag expirations or applying them. There is no event for expirations occurring, as they don't "occur" per se.
In other words, it is correct to say a flag "is expired" or a flag "is not expired",
but it is incorrect to say a flag "expires", as it is not an active action (though this wording can be convenient when speaking informally).
Expired flags are sometimes 'cleaned up' (meaning, any expired flags get actually removed from internal storage), usually when a flag save file is loaded into the server.

As a bonus feature-combo, it is possible to transmit sets of flags exactly in-place and reapply them, this is particular useful for example to synchronize player data across Bungee servers.
To do this, you can read raw flag data with the tag Tag:FlaggableObject.flag_map and the '__raw' prefix in a flag command. For example:

# Gather the original data
- define playerdata <player.flag_map[flag1|flag2|taco|potato|waffle|etc]>
# Now reapply it elsewhere (eg a different Bungee server)
- flag <player> __raw:<[playerdata]>
GroupDenizen Scripting Language
Sourcehttps://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/commands/core/FlagCommand.java#L34
NameSafety In Events
DescriptionOne of the more common issues in Denizen scripts (particularly ones relating to inventories) is
*event safety*. That is, using commands inside an event that don't get along with the event.

The most common example of this is editing a player's inventory, within an inventory-related event.
Generally speaking, this problem becomes relevant any time an edit is made to something involved with an event,
within the firing of that event.
Take the following examples:

on player clicks in inventory:
- take iteminhand
on entity damaged:
- remove <context.entity>


In both examples above, something related to the event (the player's inventory, and the entity being damaged)
is being modified within the event itself.
These break due a rather important reason: The event is firing before and/or during the change to the object.
Most events operate this way. A series of changes *to the object* are pending, and will run immediately after
your script does... the problems resultant can range from your changes being lost to situational issues
(eg an inventory suddenly being emptied entirely) to even server crashes!
The second example event also is a good example of another way this can go wrong:
Many scripts and plugins will listen to the entity damage event, in ways that are simply unable to handle
the damaged entity just being gone now (when the event fires, it's *guaranteed* the entity is still present
but that remove command breaks the guarantee!).

The solution to this problem is simple: Use "after" instead of "on".

after player clicks in inventory:
- take iteminhand
after entity damaged:
- if <context.entity.is_spawned||false>:
  - remove <context.entity>

This will delay the script until *after* the event is complete, and thus outside of the problem area.
And thus should be fine. One limitation you should note is demonstrated in the second example event:
The normal guarantees of the event are no longer present (eg that the entity is still valid) and as such
you should validate these expectations remain true after the event (as seen with the 'if is_spawned' check).
(See also Language:Script Event After vs On)

If you need determine changes to the event, you can instead use 'on' but add a 'wait 1t' after the determine but before other script logic.
This allows the risky parts to be after the event and outside the problem area, but still determine changes to the event.
Be sure to use 'passively' to allow the script to run in full.

on player clicks in inventory:
- determine passively cancelled
- wait 1t
- take iteminhand
on entity damaged:
- determine passively cancelled
- wait 1t
- if <context.entity.is_spawned||false>:
  - remove <context.entity>
GroupScript Events
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/BukkitScriptEvent.java#L934

Mechanism


Namedamage_item
ObjectEntityTag
InputMapTag
DescriptionDamages the given equipment slot for the given amount.
This runs all vanilla logic associated with damaging an item like gamemode and enchantment checks, events, stat changes, advancement triggers, and notifying clients to play break animations.
Input is a map with "slot" as a valid equipment slot, and "amount" as the damage amount to be dealt.
Valid equipment slot values can be found at 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/EquipmentSlot.html.
Example
# Damages your precious boots! :(
- adjust <player> damage_item:[slot=feet;amount=45]
Grouppaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/properties/PaperEntityExtensions.java#L160
Namedisabled_slots
ObjectEntityTag
InputMapTag
Related Tags<EntityTag.disabled_slots_data> If the entity is an armor stand, returns its disabled slots as a map of slot names to list of actions.
DescriptionSets the disabled slots of an armor stand as a map of slot names to list of actions.
For example: [HEAD=PLACE|REMOVE;CHEST=PLACE;FEET=ALL]
Provide no input to enable all slots.
Slots: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/EquipmentSlot.html
Actions: ALL, REMOVE, PLACE
NOTE: Minecraft contains a bug where disabling ALL for the HAND slot still allows item removal.
To fully disable hand interaction, disable ALL and REMOVE.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityDisabledSlots.java#L159
Namestrength
ObjectEntityTag
InputElementTag(Boolean)
Related Tags<EntityTag.strength> Returns the strength of a Llama. A llama's inventory contains (strength times three) slots. (...)
DescriptionSets the strength of a Llama. A llama's inventory contains (strength times three) slots.
Can be from 1 to 5 (inclusive).
Generated Example
- adjust <player> strength:false
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityStrength.java#L69
Nameenchantments
ObjectItemTag
InputMapTag
Related Tags<ItemTag.enchantment_map> Returns a map of enchantments on the item. (...)
DescriptionSets the item's enchantments as a map of EnchantmentTags or enchantment names to level.
For example: - inventory adjust slot:hand enchantments:sharpness=1
Does not remove existing enchantments, for that use Mechanism:ItemTag.remove_enchantments
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemEnchantments.java#L239
Nametrim
ObjectItemTag
InputMapTag
Related Tags<ItemTag.trim> (Property) An armor item's trim. (...)
Description(Property) An armor item's trim.
Allowed keys: material, pattern.
Valid material values can be found here: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/trim/TrimMaterial.html
Valid pattern values can be found here: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/trim/TrimPattern.html
Valid values also include ones added by datapacks, plugins, etc. as a namespaced key.
For the mechanism, if an item already has a trim, you can omit either material or pattern to keep the original data while also changing the other option.
For example, if you only want to change the pattern and not the material, you can omit the material, and it will use the already existing material.
To remove the trim provide no input.
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemTrim.java#L16
Namelast_interacted_slot
ObjectLocationTag
InputElementTag(Number)
Related Tags<LocationTag.last_interacted_slot> Returns the last interacted slot of a Chiseled Bookshelf inventory.
DescriptionSets the last interacted slot of a Chiseled Bookshelf inventory.
Generated Example
- adjust <player.location> last_interacted_slot:3
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L4537
Namemax_stack_size
ObjectMaterialTag
InputElementTag(Number)
Related Tags<MaterialTag.max_stack_size> Returns the maximum amount of this material that can be held in a stack.
DescriptionSets the maximum stack size for all items this material type.
Note that altering this will probably require a script performing "- inventory update" in the event "after player clicks in inventory:" to maintain sync.
The maximum the client will interact with is stacks of 64, however you can set the max up to 127 and the client will render it, but refuse to move stacks properly.
Generated Example
- adjust <material[stone]> max_stack_size:3
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/MaterialTag.java#L742
Nameitem_slot
ObjectPlayerTag
InputElementTag(Number)
Related Tags<PlayerTag.held_item_slot> Returns the slot location of the player's selected item.
DescriptionSets the inventory slot that the player has selected.
Works with offline players.
Generated Example
- adjust <player> item_slot:2
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java#L2863
Namewindow_property
ObjectPlayerTag
InputElementTag
DescriptionSets various properties of a window the player has open, such as the open page in a lectern.
Input is of the form PROPERTY,VALUE where the value is a number.
Note that any adjusted window properties are entirely clientside.
Valid properties: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/InventoryView.Property.html
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java#L2882

ObjectType


NameItemTag
Prefixi@
Base TypeElementTag
ImplementsFlaggableObject, PropertyHolderObject
Identity FormatThe identity format for items is the basic material type name, or an item script name. Other data is specified in properties.
For example, 'i@stick'.
DescriptionAn ItemTag represents a holdable item generically.

ItemTags are temporary objects, to actually modify an item in an inventory you must add the item into that inventory.

ItemTags do NOT remember where they came from. If you read an item from an inventory, changing it
does not change the original item in the original inventory. You must set it back in.

Find a list of valid materials at:
🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
Note that some materials on that list are exclusively for use with blocks, and cannot be held as items.

This object type is flaggable.
Flags on this object type will be stored in the item NBT.
MatchableItemTag matchers, sometimes identified as "<item>", often seen as "with:<item>":
"potion": plaintext: matches if the item is any form of potion item.
"script": plaintext: matches if the item is any form of script item.
"item_flagged:<flag>": A Flag Matcher for item flags.
"item_enchanted:<enchantment>": matches if the item is enchanted with the given enchantment name (excluding enchantment books). Allows advanced matchers.
"raw_exact:<item>": matches based on exact raw item data comparison (almost always a bad idea to use).
Item property format: will validate that the item material matches and all directly specified properties also match. Any properties not specified won't be checked.
for example "stick[display=Hi]" will match any 'stick' with a displayname of 'hi', regardless of whether that stick has lore or not, or has enchantments or not, or etc.
Item script names: matches if the item is a script item with the given item script name, using advanced matchers.
If none of the above are used, uses MaterialTag matchables. Refer to MaterialTag matchable list above.
Note that "item" plaintext is always true.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/ItemTag.java#L56
NameTradeTag
Prefixtrade@
Base TypeElementTag
ImplementsPropertyHolderObject
Identity FormatThe identity format for trades is just the text 'trade'. All other data is specified through properties.
DescriptionMerchant trades are the parts of a special merchant inventory that is typically viewed by right clicking
a villager entity. Any number of trades can fit in a single merchant inventory.

Trades are represented by TradeTags.

The properties that can be used to customize a merchant trade are:

result=<item>
inputs=<item>(|<item>)
uses=<number of uses>
max_uses=<maximum number of uses>
has_xp=true/false

For example, the following command opens a virtual merchant inventory with two merchant trades.
The first trade offers a sponge for two emeralds, can be used up to 10 times,
and offers XP upon a successful transaction.
The second trade has zero maximum uses and displays a barrier in the input and output slots.

- opentrades trade[max_uses=10;inputs=emerald[quantity=2];result=sponge]|trade[inputs=barrier;result=barrier]
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/TradeTag.java#L17

Tag


Name<EntityTag.strength>
ReturnsElementTag
MechanismEntityTag.strength
DescriptionReturns the strength of a Llama. A llama's inventory contains (strength times three) slots.
Can be from 1 to 5 (inclusive).
Generated Example
- narrate <player.strength>
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityStrength.java#L52
Name<ItemTag.trim>
ReturnsMapTag
MechanismItemTag.trim
Description(Property) An armor item's trim.
Allowed keys: material, pattern.
Valid material values can be found here: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/trim/TrimMaterial.html
Valid pattern values can be found here: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/trim/TrimPattern.html
Valid values also include ones added by datapacks, plugins, etc. as a namespaced key.
For the mechanism, if an item already has a trim, you can omit either material or pattern to keep the original data while also changing the other option.
For example, if you only want to change the pattern and not the material, you can omit the material, and it will use the already existing material.
Generated Example
- foreach <player.item_in_hand.trim> key:key as:val:
    - narrate "<[key]> is set as <[val]>"
GroupProperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemTrim.java#L16
Name<LocationTag.last_interacted_slot>
ReturnsElementTag(Number)
MechanismLocationTag.last_interacted_slot
DescriptionReturns the last interacted slot of a Chiseled Bookshelf inventory.
Generated Example
- narrate "the number value is <player.location.last_interacted_slot>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L4284
Name<PlayerTag.enderchest>
ReturnsInventoryTag
DescriptionGets the player's enderchest inventory.
Works with offline players.
Generated Example
- note <player.enderchest> as:my_new_inventory
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java#L1519

Just Barely Matched Results



Command


NameEquip
Syntaxequip (<entity>|...) (hand:<item>) (offhand:<item>) (head:<item>) (chest:<item>) (legs:<item>) (boots:<item>) (saddle:<item>) (horse_armor:<item>)
Short DescriptionEquips items and armor on a list of entities.
Full DescriptionThis command equips an item or armor to an entity or list of entities to the specified slot(s).
Set the item to 'air' to unequip any slot.
Related Tags<EntityTag.equipment> Returns a ListTag containing the entity's equipment. (...)
<InventoryTag.equipment> Returns the equipment of an inventory as a list of items. (...)
Usage Example
# Use to equip a stone block on the player's head.
- equip <player> head:stone
Usage Example
# Use to equip an iron helmet on two defined players.
- equip <[player]>|<[someplayer]> head:iron_helmet
Usage Example
# Use to unequip all armor off the player.
- equip <player> head:air chest:air legs:air boots:air
Usage Example
# Use to equip a saddle on the horse the player is riding.
- equip <player.vehicle> saddle:saddle
Usage Example
# Use to equip a saddle on all nearby pigs.
- equip <player.location.find_entities[pig].within[10]> saddle:saddle
Groupentity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java#L32
NameFakeEquip
Syntaxfakeequip [<entity>|...] (for:<player>|...) (duration:<duration>/reset) (hand:<item>) (offhand:<item>) (head:<item>) (chest:<item>) (legs:<item>) (boots:<item>)
Short DescriptionFake-equips items and armor on a list of entities for players to see without real change.
Full DescriptionThis command fake-equips items and armor on a list of entities.

The change doesn't happen on-server, and no armor effects will happen from it.

The equipment can only be seen by certain players. By default, the linked player is used.

The changes will remain in place for as long as the duration is specified (even if the real equipment is changed).
The changes can be manually reset early by using the 'reset' argument.
If you do not provide a duration, the fake equipment will last until manually reset.
This does not persist across server restarts.

Set the item to 'air' to unequip any slot.
Related Tags<EntityTag.equipment> Returns a ListTag containing the entity's equipment. (...)
<InventoryTag.equipment> Returns the equipment of an inventory as a list of items. (...)
Usage Example
# Use to fake-equip a stone block on the player's head.
- fakeequip <player> head:stone duration:10s
Usage Example
# Use to fake-equip an iron helmet on two defined players.
- fakeequip <[player]>|<[someplayer]> head:iron_helmet duration:1m
Usage Example
# Use to fake-unequip all armor off the player.
- fakeequip <player> head:air chest:air legs:air boots:air duration:5s
Usage Example
# Use to make all players within 30 blocks of an entity see it permanently equip a shield.
- fakeequip <[entity]> offhand:shield for:<[entity].find_players_within[30]> duration:0
Groupentity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FakeEquipCommand.java#L34

Language


NameSlot Inputs
DescriptionWhenever a script component requires a slot ID (such as the take command, when using '- take slot:#')
you can give the slot ID input as either a number of the 1-based index (where the first slot is 1, the second is 2, etc.)
If the slot given is 'hand', for a player the held item slot will be used, for any other entity the slot will be 1.
OR you can give the following names (valid for player inventories only):
BOOTS: equivalent to 37
LEGGINGS: equivalent to 38
CHESTPLATE: equivalent to 39
HELMET: equivalent to 40
OFFHAND: equivalent to 41

Note that some common alternate spellings may be automatically accepted as well.
GroupUseful Lists
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/utilities/inventory/SlotHelper.java#L72