Class ItemEntityPickupEvent.Post

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent
net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent.Post
Enclosing class:
ItemEntityPickupEvent

public static class ItemEntityPickupEvent.Post extends ItemEntityPickupEvent
This event is fired when an ItemEntity on the ground has been picked up by the player and after the item is added to the player's inventory.

This event only fires if part of the item was picked up by the player.

If the remaining item stack is empty, the item entity will be discarded.

This event is only fired on the logical server.

  • Field Details

    • originalStack

      private final net.minecraft.world.item.ItemStack originalStack
  • Constructor Details

    • Post

      public Post(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.item.ItemEntity item, net.minecraft.world.item.ItemStack originalStack)
  • Method Details

    • getOriginalStack

      public net.minecraft.world.item.ItemStack getOriginalStack()
      Returns a copy of the original stack, before it was added to the player's inventory. Changes to this item stack have no effect on any further processing.
    • getCurrentStack

      public net.minecraft.world.item.ItemStack getCurrentStack()
      Returns a live reference to the remaining stack held by the ItemEntity.