@FunctionalInterface public static interface PlayerBlockBreakEvents.Before
| Modifier and Type | Method and Description |
|---|---|
boolean |
beforeBlockBreak(net.minecraft.world.World world,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
net.minecraft.block.entity.BlockEntity blockEntity)
Called before a block is broken and allows cancelling the block breaking.
|
boolean beforeBlockBreak(net.minecraft.world.World world,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.math.BlockPos pos,
net.minecraft.block.BlockState state,
net.minecraft.block.entity.BlockEntity blockEntity)
Implementations should not modify the world or assume the block break has completed or failed.
world - the world in which the block is brokenplayer - the player breaking the blockpos - the position at which the block is brokenstate - the block state before the block is brokenblockEntity - the block entity before the block is broken, can be nullfalse to cancel block breaking action, or true to pass to next listener