Interface BlockEvent.Break
- Enclosing interface:
- BlockEvent
public static interface BlockEvent.Break
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.InteractionResult
breakBlock
(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.server.level.ServerPlayer player, @Nullable IntValue xp) Invoked when a block is destroyed by a player.
-
Method Details
-
breakBlock
net.minecraft.world.InteractionResult breakBlock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, net.minecraft.server.level.ServerPlayer player, @Nullable @Nullable IntValue xp) Invoked when a block is destroyed by a player.- Parameters:
world
- The level the block is in.pos
- The position of the block.state
- The current state of the block.player
- The player who is breaking the block.xp
- The experience that are dropped when the block was destroyed. Alwaysnull
on fabric.- Returns:
- Return
InteractionResult.FAIL
to cancel the block breaking.
-