Class InventoryCloseEvent
java.lang.Object
net.minestom.server.event.inventory.InventoryCloseEvent
- All Implemented Interfaces:
Event
,EntityEvent
,EntityInstanceEvent
,InstanceEvent
,InventoryEvent
,PlayerEvent
,PlayerInstanceEvent
Called when an
Inventory
is closed by a player.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable Inventory
Gets the inventory.@Nullable Inventory
Gets the new inventory to open.@NotNull Player
Gets the player who closed the inventory.void
setNewInventory
(@Nullable Inventory newInventory) Can be used to open a new inventory after closing the previous one.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstance
Methods inherited from interface net.minestom.server.event.trait.PlayerEvent
getEntity
-
Constructor Details
-
InventoryCloseEvent
-
-
Method Details
-
getPlayer
Gets the player who closed the inventory.- Specified by:
getPlayer
in interfacePlayerEvent
- Returns:
- the player who closed the inventory
-
getNewInventory
Gets the new inventory to open.- Returns:
- the new inventory to open, null if there isn't any
-
setNewInventory
Can be used to open a new inventory after closing the previous one.- Parameters:
newInventory
- the inventory to open, null to do not open any
-
getInventory
Description copied from interface:InventoryEvent
Gets the inventory.- Specified by:
getInventory
in interfaceInventoryEvent
- Returns:
- the inventory, null if this is a player's inventory
-