Interface PlayerOpenInventoryEvent
- All Superinterfaces:
Cancellable, Event, PlayerEvent
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 Summary
Modifier and TypeMethodDescriptionReturns the block the window is opened on, empty when it belongs to no block.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.menuType()Returns the kind of window the client draws, one ofMenuTypeKeys.title()Returns the title shown at the top of the window.Methods inherited from interface Cancellable
isCancelled, setCancelledMethods inherited from interface PlayerEvent
player
-
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