Interface PlayerEvent.PickupItemPredicate

Enclosing interface:
PlayerEvent

public static interface PlayerEvent.PickupItemPredicate
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.InteractionResult
    canPickup(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.item.ItemEntity entity, net.minecraft.world.item.ItemStack stack)
    Invoked when a player tries to pickup an ItemEntity.
  • Method Details

    • canPickup

      net.minecraft.world.InteractionResult canPickup(net.minecraft.world.entity.player.Player player, net.minecraft.world.entity.item.ItemEntity entity, net.minecraft.world.item.ItemStack stack)
      Invoked when a player tries to pickup an ItemEntity. Equivalent to Forge's EntityItemPickupEvent event.
      Parameters:
      player - The player picking up.
      entity - The ItemEntity that the player tries to pick up.
      stack - The content of the ItemEntity.
      Returns:
      Forge ignores the return value. On Fabric a InteractionResult.FAIL results in the event getting canceled and the item not being picked up.