Class InventoryItemChangeEvent
java.lang.Object
net.minestom.server.event.inventory.InventoryItemChangeEvent
- All Implemented Interfaces:
Event
,InventoryEvent
,RecursiveEvent
Called when
AbstractInventory.setItemStack(int, ItemStack)
is being invoked.
This event cannot be cancelled and items related to the change are already moved.-
Constructor Summary
ConstructorDescriptionInventoryItemChangeEvent
(@NotNull AbstractInventory inventory, int slot, @NotNull ItemStack previousItem, @NotNull ItemStack newItem) -
Method Summary
Modifier and TypeMethodDescription@NotNull AbstractInventory
Gets the inventory that was clicked.@NotNull ItemStack
Gets a new item on a changed slot.@NotNull ItemStack
Gets a previous item that was on changed slot.int
getSlot()
Gets the changed slot number.
-
Constructor Details
-
InventoryItemChangeEvent
public InventoryItemChangeEvent(@NotNull @NotNull AbstractInventory inventory, int slot, @NotNull @NotNull ItemStack previousItem, @NotNull @NotNull ItemStack newItem)
-
-
Method Details
-
getSlot
public int getSlot()Gets the changed slot number.- Returns:
- the changed slot number.
-
getPreviousItem
Gets a previous item that was on changed slot.- Returns:
- a previous item that was on changed slot.
-
getNewItem
Gets a new item on a changed slot.- Returns:
- a new item on a changed slot.
-
getInventory
Description copied from interface:InventoryEvent
Gets the inventory that was clicked.- Specified by:
getInventory
in interfaceInventoryEvent
-