Class InventoryOpenEvent
java.lang.Object
net.minestom.server.event.Event
net.minestom.server.event.CancellableEvent
net.minestom.server.event.inventory.InventoryOpenEvent
public class InventoryOpenEvent extends CancellableEvent
Called when a player open an
Inventory
.
Executed by Player.openInventory(Inventory)
.
-
Constructor Summary
Constructors Constructor Description InventoryOpenEvent(Player player, Inventory inventory)
-
Method Summary
Modifier and Type Method Description Inventory
getInventory()
Gets the inventory to open, this could have been change by thesetInventory(Inventory)
.Player
getPlayer()
Gets the player who opens the inventory.void
setInventory(Inventory inventory)
Changes the inventory to open.
-
Constructor Details
-
Method Details
-
getPlayer
Gets the player who opens the inventory.- Returns:
- the player who opens the inventory
-
getInventory
Gets the inventory to open, this could have been change by thesetInventory(Inventory)
.- Returns:
- the inventory to open, null to just close the current inventory if any
-
setInventory
Changes the inventory to open.To do not open any inventory see
CancellableEvent.setCancelled(boolean)
.- Parameters:
inventory
- the inventory to open
-