Interface PlayerBlockBreakEvents.Before
- Enclosing class:
PlayerBlockBreakEvents
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
beforeBlockBreak
(World world, PlayerEntity player, BlockPos pos, BlockState state, BlockEntity blockEntity) Called before a block is broken and allows cancelling the block breaking.
-
Method Details
-
beforeBlockBreak
boolean beforeBlockBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, BlockEntity blockEntity) Called before a block is broken and allows cancelling the block breaking.Implementations should not modify the world or assume the block break has completed or failed.
- Parameters:
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 benull
- Returns:
false
to cancel block breaking action, ortrue
to pass to next listener
-