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