Skip to content

API reference Obsidian.API.Events

BlockPlaceEventArgs class

A player placing a block, raised before the block is placed and the item used up. Cancelling it keeps the block from being placed, and the player keeps the item.

public sealed class BlockPlaceEventArgs : BlockEventArgs, ICancellable

In Obsidian.API.

Properties

Hand

public InteractionHand Hand { get; }

The hand holding the block's item.

IsCancelled

public bool IsCancelled { get; }

Gets a value indicating whether the default behaviour should be cancelled.

Player

public IPlayer Player { get; }

The player placing the block.

Methods

Cancel()

public void Cancel();

Sets a flag which prevents default (vanilla) behavior from executing.

Remarks

This flag only affects vanilla behavior. If you wish to prevent other handlers from running, see AsyncEventArgs.Handled.

On this page