Class PlayerAddItemStackEvent

java.lang.Object
net.minestom.server.event.Event
net.minestom.server.event.CancellableEvent
net.minestom.server.event.player.PlayerAddItemStackEvent

public class PlayerAddItemStackEvent
extends CancellableEvent
  • Constructor Summary

    Constructors 
    Constructor Description
    PlayerAddItemStackEvent​(Player player, ItemStack itemStack)  
  • Method Summary

    Modifier and Type Method Description
    ItemStack getItemStack()
    Gets the item stack which will be added.
    Player getPlayer()
    Gets the player who has an item stack added to his inventory.
    void setItemStack​(ItemStack itemStack)
    Changes the item stack which will be added.

    Methods inherited from class net.minestom.server.event.CancellableEvent

    isCancelled, setCancelled

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getPlayer

      @NotNull public Player getPlayer()
      Gets the player who has an item stack added to his inventory.
      Returns:
      the player
    • getItemStack

      @NotNull public ItemStack getItemStack()
      Gets the item stack which will be added.
      Returns:
      the item stack
    • setItemStack

      public void setItemStack​(@NotNull ItemStack itemStack)
      Changes the item stack which will be added.
      Parameters:
      itemStack - the new item stack