Class InventoryClickEvent

All Implemented Interfaces:
Cancellable
Direct Known Subclasses:
CraftItemEvent, InventoryCreativeEvent

public class InventoryClickEvent
extends InventoryInteractEvent
This event is called when a player clicks in an inventory.

Because InventoryClickEvent occurs within a modification of the Inventory, not all Inventory related methods are safe to use.

The following should never be invoked by an EventHandler for InventoryClickEvent using the HumanEntity or InventoryView associated with this event:

To invoke one of these methods, schedule a task using BukkitScheduler.runTask(Plugin, Runnable), which will run the task on the next tick. Also be aware that this is not an exhaustive list, and other methods could potentially create issues as well.

Assuming the EntityHuman associated with this event is an instance of a Player, manipulating the MaxStackSize or contents of an Inventory will require an Invocation of Player.updateInventory().

Modifications to slots that are modified by the results of this InventoryClickEvent can be overwritten. To change these slots, this event should be cancelled and all desired changes to the inventory applied. Alternatively, scheduling a task using BukkitScheduler.runTask( Plugin, Runnable), which would execute the task on the next tick, would work as well.