Item Events
ITEM INTERACT
Event called when a player clicks on an item.
example:
type: item_interact
conditions:
- '%item% == REDSTONE'
actions:
default:
- 'cancel_event: true'
- "message: &cYou can''t use redstone."
Variables:
%action_type% (Could be: RIGHT_CLICK, LEFT_CLICK, SHIFT_RIGHT_CLICK, SHIFT_LEFT_CLICK)
ConditionalEvents item variables
ITEM CONSUME
Event called when a player consumes an item (eat food for example)
example:
type: item_consume
conditions:
- '%item% == GOLDEN_APPLE'
- '%random_1_10% >= 8'
actions:
default:
- "give_potion_effect: INCREASE_DAMAGE;120;1;false"
Variables:
ConditionalEvents item variables
ITEM PICKUP
Event called when a player pickups an item.
example:
type: item_pickup
conditions:
- '%player_world% == minigames'
actions:
default:
- "cancel_event: true"
Variables:
ConditionalEvents item variables
ITEM MOVE
Event called when a player tries to move an item from its inventory.
example:
type: item_move
conditions:
- "%inventory_type% == ANVIL"
actions:
default:
- "message: &cNope!"
- "cancel_event: true"
Variables:
%inventory_type% (Type of the open inventory. All types on this link: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/InventoryType.html)
%inventory_title% (Name of the open inventory)
%slot% (Selected slot)
ConditionalEvents item variables
ITEM CRAFT
Event called when a player is about to craft an item.
example:
type: item_craft
conditions:
- "%item% == WRITABLE_BOOK"
actions:
default:
- "message: &cYou can't craft writable books!"
- "cancel_event: true"
Variables:
ConditionalEvents item variables
ITEM DROP
Event called when a player drops an item.
example:
type: item_drop
conditions:
- '%player_world% == minigames'
actions:
default:
- "cancel_event: true"
Variables:
ConditionalEvents item variables
ITEM SELECT
Event called when a player selects/deselects an item in their hotbar.
example:
type: item_select
conditions:
- '%item% == DIAMOND_SWORD'
- '%item_name% == Super Diamond Sword'
- '%select_type% == SELECT'
actions:
default:
- "actionbar: &6Equipping your Super Diamond Sword;60"
Variables:
%select_type% (Could be: SELECT or DESELECT)
ConditionalEvents item variables
ITEM ENCHANT
Event called when a player enchants an item.
example:
type: item_enchant
conditions:
- "%item% contains _SWORD"
- "%enchantment_list% contains DURABILITY"
actions:
default:
- "cancel_event: true"
- "message: &cYou can't enchant swords with durability!"
Variables:
%enchantment_list% (List of enchantments to be applied to the item. It will return a string with the following format:
<enchantment1>:<level1>;<enchantment2>:<level2>;...
)ConditionalEvents item variables
ITEM REPAIR
Event called when a player repairs an item.
example:
type: item_repair
conditions:
- "%item% == NETHERITE_SWORD"
- "%rename_text% == Super Sword"
actions:
default:
- "cancel_event: true"
- "message: &cYou can't rename a netherite sword to that name!"
Variables:
%rename_text% (New name of the item if the player is renaming it)
ConditionalEvents item variables
Only works on 1.13+!
Last updated
Was this helpful?