Activator INVENTORY_CLICK

This activator works when the player performs actions with the inventory using the mouse or keys

/react add INVENTORY_CLICK <ActivatorId> [click:<ClickType>] [action:<InventoryAction>] [inventory:<InventoryType>] [slotType:<SlotType>] [key:1..9/ANY] [item:<Item>] [slot:0..35/ANY]

ElementPossible valuesDescription
name``The Inventory name.
clickANY, CONTROL_DROP, CREATIVE, DOUBLE_CLICK, DROP, LEFT, MIDDLE, NUMBER_KEY, RIGHT, SHIFT_LEFT, SHIFT_RIGHT, UNKNOWN, WINDOW_BORDER_LEFT, WINDOW_BORDER_RIGHT
The type of click that triggered the activator. By default click:ANY - triggered by any action.
actionANY, CLONE_STACK, COLLECT_TO_CURSOR, DROP_ALL_CURSOR, DROP_ALL_SLOT, DROP_ONE_CURSOR, DROP_ONE_SLOT, HOTBAR_MOVE_AND_READD, HOTBAR_SWAP, MOVE_TO_OTHER_INVENTORY, NOTHING, PICKUP_ALL, PICKUP_HALF, PICKUP_ONE, PICKUP_SOME, PLACE_ALL, PLACE_ONE, PLACE_SOME, SWAP_WITH_CURSOR, UNKNOWNThe type of action that triggered the activator. By default action:ANY - triggered by any action in the inventory.
inventoryANY, ANVIL, BEACON, BREWING, CHEST, CRAFTING, CREATIVE, DISPENSER, DROPPER, ENCHANTING, ENDER_CHEST, HOPPER, MERCHANT, PLAYER, SHULKER_BOX, WORKBENCHThe inventory type. Default inventory:ANY - triggered by any inventory type
slotTypeANY, ARMOR, CONTAINER, CRAFTING, FUEL, OUTSIDE, QUICKBAR, RESULTThe slot type. Default slotType:ANY - triggered by any slot type
keyANY, 1..9The number key corresponding to the slot in the bottom toolbar. Default key:ANY.
slotANY, 0..35The number slot. Default slot:ANY.

Temporary placeholders provided by this activator

PlaceholderDescription
%name%Shows, at what Inventory name
%click%Shows, at what action of the player the activator has worked
%action%Shows the action of the player in the inventory
%inventory%Shows the type of inventory that the player uses.
%slotType%Shows the slotType used by the player.
%item%Displays the item in the slot that the player clicked on.
%key%Shows the key that the player pressed: 1..9. If % key% = 0, then the key is not pressed.
%itemkey%Displays the item corresponding to the player's button pressed in the lower inventory.
%slot%Shows the slot that the player clicked: 0..35.

Examples

  1. We will display all the events that occur during actions in the inventory:
    /react add inventory_click ic_event
    /react add ic_event a message "&aclick: &r%click%"
    /react add ic_event a message "&baction: &r%action%"
    /react add ic_event a message "&cinventory: &r%inventory%"
    /react add ic_event a message "&dslot: &r%slot%"
    or
INVENTORY_CLICK:
  ic_event:
    click-type: ANY
    action-type: ANY
    inventory-type: ANY
    slot-type: ANY
    item: ''
    key: ANY
    slot: ANY
    actions:
    - 'message=&aclick: &r%click%'
    - 'message=&baction: &r%action%'
    - 'message=&cinventory: &r%inventory%'
    - 'message=&dslot-type: &r%slotType%'
    - 'message=&6item: &r%item%'
    - 'message=&6key: &r%key%'
    - 'message=&6itemkey: &r%itemkey%'
    - 'message=&6slot: &r%slot%'
  1. We forbid to craft a chest.
    /react add inventory_click chest slot:result item:{type:chest}
    /react add chest a cancel_event true
    or
INVENTORY_CLICK:
  chest:
    click-type: ANY
    action-type: ANY
    slot-type: RESULT
    item: type:chest
    actions:
    - cancel_event=true
  1. We prohibit moving the golden block from/into the chest
    /react add inventory_click chest_deny inventory:chest item:{type:GOLD_BLOCK}
    /react add chest_deny a cancel_event true
    or
INVENTORY_CLICK:
  chest_deny:
    click-type: ANY
    action-type: ANY
    inventory-type: CHEST
    slot-type: ANY
    item: type:GOLD_BLOCK
    actions:
    - cancel_event=true