Package net.minestom.server.event.player
Class PlayerSetItemStackEvent
java.lang.Object
net.minestom.server.event.Event
net.minestom.server.event.CancellableEvent
net.minestom.server.event.player.PlayerSetItemStackEvent
public class PlayerSetItemStackEvent extends CancellableEvent
Called as a result of
PlayerInventory.setItemStack(int, ItemStack)
and player click in his inventory.-
Constructor Summary
Constructors Constructor Description PlayerSetItemStackEvent(Player player, int slot, ItemStack itemStack)
-
Method Summary
Modifier and Type Method Description ItemStack
getItemStack()
Gets the item stack which will be set.Player
getPlayer()
Gets the player who has an item stack set to his inventory.int
getSlot()
Gets the slot where the item will be set.void
setItemStack(ItemStack itemStack)
Changes the item stack which will be set.void
setSlot(int slot)
Changes the slot where the item will be set.
-
Constructor Details
-
Method Details
-
getPlayer
Gets the player who has an item stack set to his inventory.- Returns:
- the player
-
getSlot
public int getSlot()Gets the slot where the item will be set.- Returns:
- the slot
-
setSlot
public void setSlot(int slot)Changes the slot where the item will be set.- Parameters:
slot
- the new slot
-
getItemStack
Gets the item stack which will be set.- Returns:
- the item stack
-
setItemStack
Changes the item stack which will be set.- Parameters:
itemStack
- the new item stack
-