Class InventoryCloseEvent


public class InventoryCloseEvent extends InventoryEvent
This event is called when a player closes an inventory.

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

Methods that change the view a player is looking at should never be invoked by an EventHandler for InventoryCloseEvent using the HumanEntity or InventoryView associated with this event. Examples of these include:

To invoke one of these methods, schedule a task using BukkitScheduler.runTask(org.bukkit.plugin.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.
  • Constructor Details

    • InventoryCloseEvent

      @Internal public InventoryCloseEvent(@NotNull @NotNull InventoryView transaction)
    • InventoryCloseEvent

      @Internal public InventoryCloseEvent(@NotNull @NotNull InventoryView transaction, @NotNull @NotNull InventoryCloseEvent.Reason reason)
  • Method Details

    • getPlayer

      @NotNull public final @NotNull HumanEntity getPlayer()
      Returns the player involved in this event
      Returns:
      Player who is involved in this event
    • getReason

      @NotNull public @NotNull InventoryCloseEvent.Reason getReason()
    • getHandlers

      @NotNull public @NotNull HandlerList getHandlers()
      Overrides:
      getHandlers in class InventoryEvent
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()