Interface InteractionEvent.LeftClickBlock

Enclosing interface:
InteractionEvent

public static interface InteractionEvent.LeftClickBlock
  • Method Summary

    Modifier and Type
    Method
    Description
    click(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction face)
    Invoked whenever a player left clicks a block.
  • Method Details

    • click

      EventResult click(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction face)
      Invoked whenever a player left clicks a block. Equivalent to Forge's PlayerInteractEvent.LeftClickBlock event and Fabric's AttackBlockCallback.
      Parameters:
      player - The player left clicking the block.
      hand - The hand that is used.
      pos - The position of the block in the level. Use Entity.getCommandSenderWorld() to get the level.
      face - The face of the block clicked.
      Returns:
      A EventResult determining the outcome of the event, the action may be cancelled by the result.