Skip to content

BlockInteractContext

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

public sealed class BlockInteractContext

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

Member Description
CustomBlock Block { get; } The block definition.
bool Cancelled { get; set; } Stops the item use after the block (placing a block against it, the held item’s own use).
BlockFace Face { get; } The clicked face.
Hand Hand { get; } The hand.
ItemStack Item { get; } The stack in that hand.
Player Player { get; } The player.
BlockPos Position { get; } The position of the block.
World World { get; } The dimension.
public CustomBlock Block { get; }

The block definition.

public bool Cancelled { get; set; }

Stops the item use after the block (placing a block against it, the held item’s own use).

public BlockFace Face { get; }

The clicked face.

public Hand Hand { get; }

The hand.

public ItemStack Item { get; }

The stack in that hand.

public Player Player { get; }

The player.

public BlockPos Position { get; }

The position of the block.

public World World { get; }

The dimension.

BlockFace · BlockPos · CustomBlock · Hand · ItemStack · Player · World