java.lang.Object
net.minestom.server.event.inventory.InventoryCloseEvent
- All Implemented Interfaces:
Event
,EntityEvent
,EntityInstanceEvent
,InstanceEvent
,InventoryEvent
,PlayerEvent
,PlayerInstanceEvent
Called when an
AbstractInventory
is closed by a player.-
Constructor Summary
ConstructorsConstructorDescriptionInventoryCloseEvent
(AbstractInventory inventory, Player player, boolean fromClient) -
Method Summary
Modifier and TypeMethodDescriptionGets the inventory that was clicked.Gets the new inventory to open.Gets the player who closed the inventory.boolean
Gets whether the client closed the inventory or the server did.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
-
isFromClient
public boolean isFromClient()Gets whether the client closed the inventory or the server did.- Returns:
- true if the client closed the inventory, false if the server 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 that was clicked.- Specified by:
getInventory
in interfaceInventoryEvent
-