BlockBreakContext
Namespace Mc.Scripting.Content · Kind class (sealed)
public sealed class BlockBreakContextWhat a custom block’s break handler gets. Valid during the handler only.
Properties
Section titled “Properties”| 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.
Cancelled
Section titled “Cancelled”public bool Cancelled { get; set; }Keeps the block (nothing breaks).
DropItems
Section titled “DropItems”public bool DropItems { get; set; }Whether the drops of the block are spawned (default true; nothing drops in creative mode anyway).
Player
Section titled “Player”public Player Player { get; }The player breaking it.
Position
Section titled “Position”public BlockPos Position { get; }The position.
public ItemStack Tool { get; }The tool in the player’s hand.
public World World { get; }The dimension.
See also
Section titled “See also”BlockPos · CustomBlock · ItemStack · Player · World