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
ConstructorDescriptionInventoryCloseEvent
(@NotNull AbstractInventory inventory, @NotNull Player player) -
Method Summary
Modifier and TypeMethodDescription@NotNull AbstractInventory
Gets the inventory that was clicked.@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
public InventoryCloseEvent(@NotNull @NotNull AbstractInventory inventory, @NotNull @NotNull Player player)
-
-
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 that was clicked.- Specified by:
getInventory
in interfaceInventoryEvent
-