attackBlock

open fun attackBlock(staffStack: ItemStack, world: World, attacker: LivingEntity, target: BlockPos, side: Direction, hand: Hand): EventResult(source)

Called on both the client and the server by Architectury API, when an entity attacks a block with a staff.

Return

  • EventResult.interruptTrue, EventResult.interruptFalse: Cancels vanilla block breaking, and on a Neo/Forge logical client, sends a packet to the server.

  • EventResult.interruptDefault, EventResult.pass: Lets Minecraft handle vanilla block breaking.

Parameters

staffStack

The item stack used to perform the action

world

The world the attacker is in

attacker

The entity, which attacked with the staff

target

The block the attacker attacked

side

The side of the block, which was attacked

hand

The hand of the attacker, in which the staff is