类 ItemEntityPickupEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.player.ItemEntityPickupEvent
直接已知子类:
ItemEntityPickupEvent.Post, ItemEntityPickupEvent.Pre

public abstract class ItemEntityPickupEvent extends net.neoforged.bus.api.Event
Parent class of the two events that fire when a Player collides with an ItemEntity.
另请参阅:
  • 字段详细资料

  • 构造器详细资料

    • ItemEntityPickupEvent

      public ItemEntityPickupEvent(Player player, ItemEntity item)
  • 方法详细资料

    • getPlayer

      public Player getPlayer()
      返回 the player who collided with the item。
      返回:
      the player who collided with the item
    • getItemEntity

      public ItemEntity getItemEntity()
      Returns the ItemEntity that was collided with.

      Changes to this item entity will impact further processing by the game and other event handlers.

      Modification of the stored stack ItemEntity.getItem() is legal, but consumers of this event must not call ItemEntity.setItem(ItemStack), as it will incur undefined behavior.