Interface BlockEvent.Break
- Enclosing interface:
- BlockEvent
public static interface BlockEvent.Break
-
Method Summary
Modifier and TypeMethodDescriptionbreakBlock(net.minecraft.world.level.Level level, 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
EventResult breakBlock(net.minecraft.world.level.Level level, 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:
level- 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. Alwaysnullon fabric.- Returns:
- A
EventResultdetermining the outcome of the event, the execution of the vanilla block breaking may be cancelled by the result.
-