Class PlayerInventoryItemChangeEvent

java.lang.Object
net.minestom.server.event.inventory.InventoryItemChangeEvent
net.minestom.server.event.inventory.PlayerInventoryItemChangeEvent
All Implemented Interfaces:
Event, EntityEvent, EntityInstanceEvent, InstanceEvent, InventoryEvent, PlayerEvent, PlayerInstanceEvent, RecursiveEvent

public class PlayerInventoryItemChangeEvent extends InventoryItemChangeEvent implements PlayerInstanceEvent
Called when AbstractInventory.safeItemInsert(int, ItemStack) is being invoked on a PlayerInventory. This event cannot be cancelled and items related to the change are already moved.

When this event is being called, InventoryItemChangeEvent listeners will also be triggered, so you can listen only for an ancestor event and check whether it is an instance of that class.

  • Constructor Details

    • PlayerInventoryItemChangeEvent

      public PlayerInventoryItemChangeEvent(@NotNull @NotNull Player player, int slot, @NotNull @NotNull ItemStack previousItem, @NotNull @NotNull ItemStack newItem)
  • Method Details

    • getPlayer

      @NotNull public @NotNull Player getPlayer()
      Description copied from interface: PlayerEvent
      Gets the player.
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      the player