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
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable InventoryGets the inventory.@Nullable InventoryGets the new inventory to open.@NotNull PlayerGets the player who closed the inventory.voidsetNewInventory(@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, waitMethods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstanceMethods 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:
getPlayerin 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:InventoryEventGets the inventory.- Specified by:
getInventoryin interfaceInventoryEvent- Returns:
- the inventory, null if this is a player's inventory
-