Interface InteractionEvent.RightClickItem

Enclosing interface:
InteractionEvent

public static interface InteractionEvent.RightClickItem
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.InteractionResultHolder<net.minecraft.world.item.ItemStack>
    click(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
    Invoked whenever a player uses an item on a block.
  • Method Details

    • click

      net.minecraft.world.InteractionResultHolder<net.minecraft.world.item.ItemStack> click(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
      Invoked whenever a player uses an item on a block. Equivalent to Forge's PlayerInteractEvent.RightClickItem event and Fabric's UseItemCallback.
      Parameters:
      player - The player right clicking the block.
      hand - The hand that is used.
      Returns:
      Whenever the return is not InteractionResult.PASS, the result value is used and the event is canceled.