Interface PlayerOpenInventoryEvent

All Superinterfaces:
Cancellable, Event, PlayerEvent

public interface PlayerOpenInventoryEvent extends PlayerEvent, Cancellable
Fired right before a window opens on top of the player's inventory, whatever it shows: a crafting table, a crafter, an ender chest, and every window to come.

Cancelling the event keeps the window closed, and leaves whatever the player had open as it was.

Since:
0.1.0
  • Method Details

    • title

      Component title()
      Returns the title shown at the top of the window.
      Returns:
      the title shown at the top of the window
      Since:
      0.1.0
    • blockPosition

      Optional<BlockPosition> blockPosition()
      Returns the block the window is opened on, empty when it belongs to no block.
      Returns:
      the block the window is opened on, empty when it belongs to no block
      Since:
      0.1.0
    • inventory

      Container inventory()
      Returns what the window shows above the player's inventory, such as the player's ender chest or the nine slots of a crafter; changes made to it are kept.
      Returns:
      what the window shows above the player's inventory, such as the player's ender chest or the nine slots of a crafter; changes made to it are kept
      Since:
      0.1.0