inventory_click — Events

on inventory_clickorg.bukkit.event.inventory.InventoryClickEvent
Inventory1.0.0

Description

Fires when a player clicks inside an inventory. Provides the clicked slot, click type, inventory title, clicked item, and cursor item.

Variables

player
Player
org.bukkit.entity.Player
NullableNo

The player who clicked

inventory
Inventory
org.bukkit.inventory.Inventory
NullableNo

The top inventory being viewed

name
String
java.lang.String
NullableNo

The Lumen inventory name, or empty if not a Lumen inventory

slot
int
int
NullableNo

The slot index that was clicked

rawSlot
int
int
NullableNo

The raw slot index including both top and bottom inventory

clickType
String
java.lang.String
NullableNo

The click type: LEFT, RIGHT, SHIFT_LEFT, SHIFT_RIGHT, MIDDLE, etc.

action
String
java.lang.String
NullableNo

The inventory action: PICKUP_ALL, PLACE_ALL, SWAP_WITH_CURSOR, etc.

title
String
java.lang.String
NullableNo

The display title of the inventory

item
ItemStack
org.bukkit.inventory.ItemStack
NullableYes

The item in the clicked slot, or null if the slot is empty

cursor
ItemStack
org.bukkit.inventory.ItemStack
NullableYes

The item on the cursor, or null if the cursor is empty

Examples

on inventory_click:
on inventory_click: if name is "main_menu": cancel event

Related (Inventory)