Class InventoryCloseEvent
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.booleanGets whether the client closed the inventory or the server did.voidsetNewInventory(@Nullable Inventory newInventory) Can be used to open a new inventory after closing the previous one.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EntityInstanceEvent
getInstanceMethods inherited from interface 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
-
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
-
setNewInventory
-
getInventory
Description copied from interface:InventoryEventGets the inventory that was clicked.- Specified by:
getInventoryin interfaceInventoryEvent
-