Name | player click_type clicks item in inventory |
Event Lines | player (<click_type>) clicks (<item>) in <inventory> |
Triggers | when a player clicks in an inventory. Note that you likely will also want to listen to player drags in inventory. |
Generated Examples | after player click_type clicks in inventory: |
Has Player | Always. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link. |
Switches | with:<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 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 Inventory Actions.
<context.hotbar_button> returns an ElementTag of the button pressed as a number, or 0 if no number button was pressed.
|
Determine | ItemTag to set the current item for the event. |
Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
Has Location | True - This adds the switches 'in:<area>', 'location_flagged:<flag>', ... |
Group | Player |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerClicksInInventoryScriptEvent.java#L70 |