Interface InteractionEvent.RightClickItem

Enclosing interface:
InteractionEvent

public static interface InteractionEvent.RightClickItem
  • Method Summary

    Modifier and Type
    Method
    Description
    CompoundEventResult<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

      CompoundEventResult<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:
      A EventResult determining the outcome of the event, the action may be cancelled by the result.