Skip to main content

Protocol: PlayerBreakBlockBeforeEvent

Cancelable event fired before a player breaks a block.

class PlayerBreakBlockBeforeEvent(Protocol)

Related API: Block, BrokenBlockPermutation, Dimension, ItemStack, Player

Properties

cancel

cancel: bool

Set to true before the handler returns to cancel the action.

dimension

@property
def dimension(self) -> Dimension:

Dimension containing the affected block.

Related API: Dimension

player

@property
def player(self) -> Player:

Player performing the action.

Related API: Player

block

@property
def block(self) -> Block:

Live block at the affected position.

Related API: Block

item_stack

@property
def item_stack(self) -> Optional[ItemStack]:

Detached used stack, or None for an empty hand.

Related API: ItemStack

broken_block_permutation

@property
def broken_block_permutation(self) -> BrokenBlockPermutation:

Block permutation present when the event was captured.

Related API: BrokenBlockPermutation