Skip to content

BlockBreakContext

Namespace Mc.Scripting.Content · Kind class (sealed)

public sealed class BlockBreakContext

What a custom block’s break handler gets. Valid during the handler only.

Member Description
CustomBlock Block { get; } The block definition.
bool Cancelled { get; set; } Keeps the block (nothing breaks).
bool DropItems { get; set; } Whether the drops of the block are spawned (default true; nothing drops in creative mode anyway).
Player Player { get; } The player breaking it.
BlockPos Position { get; } The position.
ItemStack Tool { get; } The tool in the player’s hand.
World World { get; } The dimension.
public CustomBlock Block { get; }

The block definition.

public bool Cancelled { get; set; }

Keeps the block (nothing breaks).

public bool DropItems { get; set; }

Whether the drops of the block are spawned (default true; nothing drops in creative mode anyway).

public Player Player { get; }

The player breaking it.

public BlockPos Position { get; }

The position.

public ItemStack Tool { get; }

The tool in the player’s hand.

public World World { get; }

The dimension.

BlockPos · CustomBlock · ItemStack · Player · World