Denizen Script Events


Events are a way to listen to things that happened on your server and respond to them through a script. These usually pair with 'world' script containers.
Learn about how events work in The Beginner's Guide.


Showing 45 out of 390 events...

Categories:

Block | Entity | Item | Player | World | Paper



Category: Block


Nameblock cooks|smelts item into item
Event Lines <block> cooks|smelts <item> (into <item>)
Triggerswhen an item is smelted/cooked by a block.
Generated Examplesafter block smelts wolf_armor:
on block cooks item into stone_slab:
Contexts<context.location> returns the LocationTag of the block smelting/cooking.
<context.source_item> returns the ItemTag that is being smelted/cooked.
<context.result_item> returns the ItemTag that is the result of the smelting/cooking.
DetermineItemTag to set the item that is the result of the smelting/cooking.
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/BlockCooksSmeltsItemScriptEvent.java#L13

Nameblock dispenses item
Event Lines <block> dispenses <item>
Triggerswhen a block dispenses an item.
Generated Examplesafter lime_banner dispenses purple_glazed_terracotta:
after gray_candle_cake dispenses diorite_stairs:
Contexts<context.location> returns the LocationTag of the dispenser.
<context.item> returns the ItemTag of the item being dispensed.
<context.velocity> returns a LocationTag vector of the velocity the item will be shot at.
DetermineLocationTag to set the velocity the item will be shot at.
ItemTag to set the item being shot.
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/BlockDispensesScriptEvent.java#L14

Nameblock tries to dispense item
Event Lines <block> tries to dispense <item>
Triggersbefore a block dispenses an item.
This event fires before the dispenser fully processes a drop, allowing access to the dispensing slot and cancellation of sound effects.
Generated Examplesafter dead_tube_coral tries to dispense item:
on block tries to dispense dark_oak_hanging_sign:
Contexts<context.location> returns the LocationTag of the dispenser.
<context.item> returns the ItemTag of the item about to be dispensed.
<context.slot> returns a ElementTag(Number) of the slot that will be dispensed from.
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/paper/src/main/java/com/denizenscript/denizen/paper/events/BlockPreDispenseScriptEvent.java#L14

Namebrewing stand fueled with item
Event Lines brewing stand fueled (with <item>)
Triggerswhen a brewing stand receives an item to use as fuel.
Generated Examplesafter brewing stand fueled with bamboo_slab:
after brewing stand fueled:
Contexts<context.location> returns the LocationTag of the brewing stand.
<context.item> returns the ItemTag being inserted as fuel.
<context.fuel_power> returns the fuel power level being added. Each unit of fuel can power one brewing operation.
<context.consuming> returns a boolean indicating whether the fuel item will be consumed.
Determine"FUEL_POWER:<ElementTag(Number)>" to set the fuel power level to be added.
"CONSUMING" to indicate that the fuel item should be consumed.
"NOT_CONSUMING" to indicate that the fuel item should not be consumed.
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/BrewingStandFueledScriptEvent.java#L14

Namecrafter crafts item
Event Lines crafter crafts <item>
Triggerswhen a crafter block crafts an item.
Generated Exampleson crafter crafts sniffer_spawn_egg:
after crafter crafts wet_sponge:
Contexts<context.location> returns the LocationTag of the crafter block.
<context.item> returns the ItemTag being crafted.
<context.recipe_id> returns the ID of the recipe formed.
Determine"ITEM:<ItemTag>" to set the item being crafted. Determinations still consume ingredients.
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/CrafterCraftsScriptEvent.java#L15

Namefurnace burns item
Event Lines furnace burns <item>
Triggerswhen a furnace burns an item used as fuel.
Generated Examplesafter furnace burns light_gray_concrete_powder:
on furnace burns crimson_planks:
Contexts<context.location> returns the LocationTag of the furnace.
<context.item> returns the ItemTag burnt.
DetermineDurationTag to set the burn time for this fuel.
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/FurnaceBurnsItemScriptEvent.java#L15

Namefurnace starts smelting item
Event Lines furnace starts smelting <item>
Triggerswhen a furnace starts smelting an item.
Example
# Sets the total cook time of every item to always be 2 seconds.
on furnace starts smelting item:
- determine 2s
Example
# Sets the total cook time of iron ore to be 2 seconds.
on furnace starts smelting iron_ore:
- determine 2s
Contexts<context.location> returns a LocationTag of the furnace's location.
<context.item> returns an ItemTag of the item being smelted.
<context.recipe_id> returns an ElementTag of the recipe ID being used.
<context.total_cook_time> returns a DurationTag of the total time it will take to smelt the item.
DetermineDurationTag to set the total cook time for the item being smelted.
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/FurnaceStartsSmeltingScriptEvent.java#L15

Nameblock equips item
Event Lines block equips <item>
Triggerswhen armor is equipped to an entity by a dispenser.
Example
# Will cause leather armor to be dispensed like a normal item and not be equipped on an armor stand.
on block equips leather* on:armor_stand:
- determined cancelled
Example
# Will equip a golden helmet if a leather helmet is originally being equipped.
on block equips leather_helmet:
- determine item:golden_helmet
Has Playerwhen the equipped entity is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Has NPCwhen the equipped entity is an NPC.
Switcheson:<entity> to only process the event if the entity having the armor equipped matches the entity input.
Contexts<context.item> returns the ItemTag of the armor being dispensed.
<context.entity> returns the EntityTag of the entity having the armor equipped.
<context.location> returns the LocationTag of the dispenser.
Determine"ITEM:<ItemTag>" to set the item being dispensed.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupBlock
Warning(s)Determined armor types must match or armor will be assigned incorrect slots (for example, if the original item was a helmet but the new item is boots, the boots will be assigned to the helmet slot and will not display properly). If you determine a non-armor item, it will be dispensed normally.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/block/BlockEquipsItemScriptEvent.java#L16



Category: Entity


Nameentity drops item
Event Lines <entity> drops <item>
Triggerswhen an entity drops an item.
Generated Examplesafter entity drops item:
after hanging drops blue_stained_glass_pane:
Has PlayerWhen the entity dropping an item is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.item> returns the ItemTag.
<context.entity> returns a EntityTag of the item.
<context.dropped_by> returns the EntityTag that dropped the item.
<context.location> returns a LocationTag of the item's location.
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/EntityDropsItemScriptEvent.java#L18

Nameentity shoots bow
Event Lines entity shoots bow
<entity> shoots <item>
Triggerswhen an entity shoots something out of a bow.
Generated Examplesafter entity shoots bow:
on monster shoots item:
after entity shoots cherry_leaves:
Has Playerwhen the entity that shot the bow is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Has NPCwhen the entity that shot the bow is an NPC.
Contexts<context.entity> returns the EntityTag that shot the bow.
<context.projectile> returns a EntityTag of the projectile.
<context.bow> returns the ItemTag of the bow used to shoot.
<context.force> returns the force of the shot.
<context.item> returns an ItemTag of the shot projectile, if any.
<context.hand> returns "HAND" or "OFF_HAND" for which hand the bow was in.
DetermineListTag(EntityTag) to change the projectile(s) being shot. (Note that in certain cases, determining an arrow may not be valid).
"KEEP_ITEM" to keep the projectile item on shooting it.
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/EntityShootsBowScriptEvent.java#L27



Category: Item


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 despawns
Event Lines <item> despawns
Triggerswhen an item entity despawns.
Generated Examplesafter stripped_spruce_wood despawns:
after item despawns:
Contexts<context.item> returns the ItemTag of the entity.
<context.entity> returns the EntityTag.
<context.location> returns the location of the entity to be despawned.
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/ItemDespawnsScriptEvent.java#L14

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 merges
Event Lines <item> merges
Triggerswhen an item entity merges into another item entity.
Generated Examplesafter oak_slab merges:
on spruce_boat merges:
Contexts<context.item> returns the ItemTag of the entity.
<context.entity> returns the EntityTag.
<context.target> returns the EntityTag being merged into.
<context.location> returns the location of the entity to be spawned.
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/ItemMergesScriptEvent.java#L15

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

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

Nameitem spawns
Event Lines <item> spawns
Triggerswhen an item entity spawns.
Generated Examplesafter acacia_chest_boat spawns:
on suspicious_sand spawns:
Contexts<context.item> returns the ItemTag of the entity.
<context.entity> returns the EntityTag.
<context.location> returns the location of the entity to be spawned.
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/ItemSpawnsScriptEvent.java#L15



Category: Player


Nameblock drops item from breaking
Event Lines block drops item from breaking
<block> drops <item> from breaking
Triggerswhen a items drop from a block due to a player breaking the block in survival mode.
Generated Examplesafter block drops item from breaking:
on block drops item from breaking:
after purple_shulker_box drops rabbit_spawn_egg from breaking:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.location> returns the LocationTag the block was broken at.
<context.material> returns the MaterialTag of the block that was broken.
<context.drop_entities> returns a ListTag of EntityTags of type DROPPED_ITEM. To get the list of ItemTags, just tack ".parse[item]" onto this context tag.
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/BlockDropsItemScriptEvent.java#L19

Nameentity picks up item
Event Lines <entity> picks up <item>
<entity> takes <item>
Triggerswhen an entity picks up an item.
Generated Examplesafter npc picks up item:
after entity takes polar_bear_spawn_egg:
after fish picks up elder_guardian_spawn_egg:
after animal takes elytra:
Has Playerwhen the entity picking up the item is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Has NPCwhen the entity picking up the item is an npc.
Contexts<context.item> returns an ItemTag of the item being picked up.
<context.entity> returns an EntityTag of the item entity being picked up.
<context.pickup_entity> returns an EntityTag of the entity picking up the item.
<context.location> returns a LocationTag of the item's location.
Determine"ITEM:<ItemTag>" to change the item being picked up.
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/entity/EntityPicksUpItemScriptEvent.java#L20

Nameplayer breaks held item
Event Lines player breaks held item
player breaks held <item>
Triggerswhen a player breaks the item they are holding.
Generated Examplesafter player breaks held item:
after player breaks held crimson_fence:
after player breaks held apple:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.item> returns the item that broke.
<context.slot> returns the slot of the item that broke.
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/PlayerBreaksItemScriptEvent.java#L21

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 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 consumes item
Event Lines player consumes item
player consumes <item>
Triggerswhen a player consumes (eats/drinks) an item (like food or potions).
Generated Exampleson player consumes item:
after player consumes item:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.item> returns the ItemTag.
<context.hand> returns an ElementTag of the hand being used to consume the item. Can be either HAND or OFF_HAND. Requires a 1.19+ server.
DetermineItemTag to change the item being consumed. Use with caution, if the player is eating a stack of items, this will replace the entire stack.
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/PlayerConsumesScriptEvent.java#L21

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 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 empties bucket
Event Lines player empties bucket
player empties <item>
Triggerswhen a player empties a bucket.
Generated Exampleson player empties bucket:
after player empties item:
after player empties grindstone:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.item> returns the ItemTag of the bucket being emptied (just material, other properties are lost - use 'player.item_in_hand' if you need full data).
<context.location> returns the LocationTag of the block clicked with the bucket.
<context.relative> returns the LocationTag of the block in front of the clicked block.
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/PlayerEmptiesBucketScriptEvent.java#L17

Nameplayer fills bucket
Event Lines player fills bucket
player fills <item>
Triggerswhen a player fills a bucket.
Generated Examplesafter player fills bucket:
after player fills blackstone_stairs:
on player fills bucket:
after player fills diorite_wall:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.item> returns the ItemTag of the filled bucket.
<context.location> returns the LocationTag of the block clicked with the bucket.
<context.material> returns the MaterialTag of the LocationTag.
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/PlayerFillsBucketScriptEvent.java#L17

Nameplayer fishes entity while state
Event Lines player fishes (<entity>) (while <state>)
player fishes (<item>) (while <state>)
Triggerswhen a player uses a fishing rod.
Generated Examplesafter player fishes entity while state:
on player fishes:
after player fishes living while state:
after player fishes item:
Has PlayerIf the fisher or the caught entity is a player (in most cases, the fisher can be assumed to be a real player). - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Has NPCIf the fisher or the caught entity is an NPC.
Switcheswith:<item> to only process the event if the fishing rod is a specified item.
Contexts<context.hook> returns an EntityTag of the hook.
<context.state> returns an ElementTag of the fishing state. Valid states: 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerFishEvent.State.html
<context.entity> returns an EntityTag of the entity that got caught.
<context.item> returns an ItemTag of the item gotten, if any.
<context.xp> returns the amount of experience that will drop.
Determine"CAUGHT:<ItemTag>" to change the item that was caught (only if an item was already being caught).
"XP:<ElementTag(Number)>" to change how much experience will drop.
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/PlayerFishesScriptEvent.java#L21

Nameplayer item takes damage
Event Lines player item takes damage
player <item> takes damage
Triggerswhen the player damages an item.
Generated Examplesafter player item takes damage:
on player item takes damage:
on player exposed_chiseled_copper takes damage:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.damage> returns the amount of damage the item has taken.
<context.original_damage> returns the original amount of damage the item would have taken, before any modifications such as the unbreaking enchantment (only on Paper).
<context.item> returns the item that has taken damage.
<context.slot> returns the slot of the item that has taken damage. This value is a bit of a hack and is not reliable.
DetermineElementTag(Number) to set the amount of damage the item will take.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
Synonyms (Search Aid)item durability changes
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerItemTakesDamageScriptEvent.java#L20

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

Nameplayer places block
Event Lines player places block
player places <item>
Triggerswhen a player places a block.
Example
on player places block:
Example
after player places torch using:off_hand:
Example
on player places cactus against:sand:
Example
# This example process the event only if the player places any block that isn't tnt.
on player places block type:!tnt:
- announce "<player.name> has placed a block that isn't TNT. Lucky!"
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesusing:<hand_type> to only process the event if the player is using the specified hand type (HAND or OFF_HAND).
against:<location> to only process the event if block that this new block is being placed against matches the specified LocationTag matcher.
type:<material> to only process the event if the block placed matches the MaterialTag matcher input.
Contexts<context.location> returns the LocationTag of the block that was placed.
<context.material> returns the MaterialTag of the block that was placed.
<context.old_material> returns the MaterialTag of the block that was replaced.
<context.item_in_hand> returns the ItemTag of the item in hand.
<context.hand> returns the name of the hand that the block was in (HAND or OFF_HAND).
<context.against> returns the LocationTag of the block this block was placed against.
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/PlayerPlacesBlockScriptEvent.java#L18

Nameplayer prepares item enchant
Event Lines player prepares item enchant
player prepares <item> enchant
Triggerswhen a player prepares to enchant an item.
Generated Exampleson player prepares item enchant:
on player prepares panda_spawn_egg enchant:
after player prepares item enchant:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.location> returns the LocationTag of the enchanting block.
<context.item> returns the ItemTag to be enchanted.
<context.bonus> returns an ElementTag(Number) of the enchanting bonus available (number of bookshelves).
<context.offers> returns a ListTag of the available enchanting offers, each as a MapTag with keys 'cost', 'enchantment_type', and 'level'.
Determine"OFFERS:<ListTag>" of MapTags to set the offers available. Cannot be a different size list than the size of context.offers.
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPreparesEnchantScriptEvent.java#L20

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 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

Nameplayer swaps items
Event Lines player swaps items
Triggerswhen a player swaps the items in their main and off hands.
Generated Examplesafter player swaps items:
on player swaps items:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesmain:<item> to only process the event if the item being put into the main hand matches the input item.
offhand:<item> to only process the event if the item being put into the off-hand matches the input item.
Contexts<context.main> returns the ItemTag switched to the main hand.
<context.offhand> returns the ItemTag switched to the off hand.
Determine"MAIN:<ItemTag>" to set the item in the main hand.
"OFFHAND:<ItemTag>" to set the item in the off hand.
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/PlayerSwapsItemsScriptEvent.java#L17

Nameplayer takes item from furnace
Event Lines player takes item from furnace
player takes <item> from furnace
Triggerswhen a player takes an item from a furnace.
Generated Exampleson player takes item from furnace:
after player takes rabbit from furnace:
after player takes item from furnace:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.location> returns the LocationTag of the furnace.
<context.item> returns the ItemTag taken out of the furnace.
DetermineElementTag(Number) to set the amount of experience the player will get.
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/PlayerTakesFromFurnaceScriptEvent.java#L17

Nameplayer takes item from lectern
Event Lines player takes item from lectern
player takes <item> from lectern
Triggerswhen a player takes a book from a lectern.
Generated Examplesafter player takes item from lectern:
on player takes waxed_weathered_chiseled_copper from lectern:
on player takes item from lectern:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.location> returns the LocationTag of the lectern.
<context.item> returns the book ItemTag taken out of the lectern.
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/PlayerTakesFromLecternScriptEvent.java#L17

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 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 raises|lowers|toggles item
Event Lines player raises|lowers|toggles <item>
Triggerswhen a player starts or stops holding up an item, such as a shield, spyglass, or crossbow.
Generated Examplesafter player raises archer_pottery_sherd:
after player raises light_blue_dye:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesreason:<reason> to only process the event if the reason matches the input.
Contexts<context.state> returns an ElementTag(Boolean) of whether the player raised or lowered the item.
<context.held_for> returns a DurationTag of how long the player held the item up for (only on Paper).
<context.hand> returns an ElementTag of the hand that the player is raising or lowering (only on Paper).
<context.item> returns an ItemTag of the item that the player is raising or lowering (only on Paper).
<context.reason> returns the reason for a state change. Can be: raise, lower, swap, hold, drop, quit, death.
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
Synonyms (Search Aid)player raises shield, player raises spyglass
GroupPlayer
Warning(s)For 'lowers', the item may be tracked incorrectly. Prefer 'player lowers item' (the generic item form) for a 'lowers' event (similar for 'toggles').
Also be aware this event may misfire in some cases.
This event and its data are more accurate on Paper servers.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRaiseLowerItemScriptEvent.java#L28

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



Category: World


Namelingering potion splash|splashes
Event Lines lingering potion splash|splashes
lingering <item> splash|splashes
Triggerswhen a lingering splash potion breaks open
Generated Exampleson lingering potion splashes:
on lingering waxed_copper_trapdoor splash:
after lingering potion splashes:
on lingering item splash:
Contexts<context.potion> returns an ItemTag of the potion that broke open.
<context.location> returns the LocationTag the splash potion broke open at.
<context.entity> returns an EntityTag of the splash potion.
<context.cloud> returns the EntityTag of the area of effect cloud.
<context.radius> returns the radius of the effect cloud.
<context.duration> returns the lingering duration of the effect cloud.
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/LingeringPotionSplashScriptEvent.java#L16

Namepotion splash|splashes
Event Lines potion splash|splashes
<item> splash|splashes
Triggerswhen a splash potion breaks open.
Example
# This example sets the intensity of the first affected entity to 0.6.
on potion splashes:
- if <context.entities.any>:
     - determine INTENSITY:[entity=<context.entities.first>;intensity=0.6]
Contexts<context.potion> returns an ItemTag of the potion that broke open.
<context.entities> returns a ListTag of affected entities.
<context.location> returns the LocationTag the splash potion broke open at.
<context.entity> returns an EntityTag of the splash potion.
<context.intensity> returns an ListTag(MapTag) of the intensity for all affected entities.
DetermineINTENSITY:<ListTag(MapTag)>" to set the intensity of specified entities.
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/PotionSplashScriptEvent.java#L25



Category: Paper


Nameplayer changes framed item
Event Lines player changes framed <item>
Triggerswhen a player interacts with an item frame by adding, removing, or rotating the item held in it.
Generated Examplesafter player changes framed chain:
after player changes framed item:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesframe:<entity> to only process the event if the item frame entity being matches the input.
action:<action> to only process the event if the change matches the input.
Contexts<context.frame> returns the EntityTag of the item frame.
<context.item> returns the ItemTag of the item held in the item frame.
<context.action> returns the ElementTag of the action being performed, based on 🔗https://jd.papermc.io/paper/1.20/io/papermc/paper/event/player/PlayerItemFrameChangeEvent.ItemFrameChangeAction.html
Determine"ITEM:<ItemTag>" to change the item held by the item frame. If there is an item already in the frame, it will be replaced. To remove the item, set it to air.
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/PlayerChangesFramedItemScriptEvent.java#L16

Nameplayer equips|unequips armor|helmet|chestplate|leggings|boots
Event Lines player equips|unequips armor|helmet|chestplate|leggings|boots
player equips|unequips <item>
Triggerswhen a player (un)equips armor.
Generated Exampleson player equips leggings:
after player unequips light_gray_banner:
after player equips leggings:
on player unequips petrified_oak_slab:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.new_item> returns the ItemTag that is now in the slot.
<context.old_item> returns the ItemTag that used to be in the slot.
<context.slot> returns the name of the slot.
GroupPaper
RequiresPaper
Warning(s)This event is not reliable, and may miss some types of equipment changes or fire when equipment hasn't actually changed.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/PlayerEquipsArmorScriptEvent.java#L22