Interface AttackBlockCallback


public interface AttackBlockCallback
Callback for left-clicking ("attacking") a block. Is hooked in before the spectator check, so make sure to check for the player's game mode as well!

On the logical client, the return values have the following meaning:

  • SUCCESS cancels further processing, causes a hand swing, and sends a packet to the server.
  • CONSUME cancels further processing, and sends a packet to the server. It does NOT cause a hand swing.
  • PASS falls back to further processing.
  • FAIL cancels further processing and does not send a packet to the server.

On the logical server, the return values have the following meaning:

  • PASS falls back to further processing.
  • Any other value cancels further processing.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.InteractionResult
    interact(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level level, net.minecraft.world.InteractionHand hand, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
     
  • Field Details

  • Method Details

    • interact

      net.minecraft.world.InteractionResult interact(net.minecraft.world.entity.player.Player player, net.minecraft.world.level.Level level, net.minecraft.world.InteractionHand hand, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)