Skip to content

BlockPistonExtendEvent

Namespace Mc.Scripting.Events · Kind struct (ref)

public ref struct BlockPistonExtendEvent : IEvent

A piston is about to extend. Cancel to keep it retracted.

Id 187
Key mc:block_piston_extend
Cancellable yes
Fired by the engine yes
Field Type Handlers may write Description
World world no (readonly) The dimension.
Pos BlockPos no (readonly) The piston.
Direction enum:BlockFace no (readonly) The push direction.
Sticky bool no (readonly) Whether it is a sticky piston.
MovedBlocks int no (readonly) Number of blocks that move.

Set e.Cancelled = true in a handler to cancel it; lower-priority handlers are skipped unless they subscribed with receiveCancelled: true.

Member Description
Constructor Creates the event (for firing it from a plugin; native code builds its own).
public BlockPistonExtendEvent(World world, BlockPos pos, BlockFace direction, bool sticky, int movedBlocks)

Creates the event (for firing it from a plugin; native code builds its own). Signature of API 1.0.

Parameters

Name Type Description
world World
pos BlockPos
direction BlockFace
sticky bool
movedBlocks int
Member Description
bool Cancelled { get; set; } Cancelling stops lower-priority handlers (unless they opt in) and the action itself.
BlockFace Direction { get; } The push direction.
int MovedBlocks { get; } Number of blocks that move.
BlockPos Pos { get; } The piston.
bool Sticky { get; } Whether it is a sticky piston.
World World { get; } The dimension.
static ushort CatalogueId { get; } Catalogue id (stable ABI).
static bool IsCancellable { get; } Whether handlers can cancel the event.
static string Key { get; } Registry key of the event.
public bool Cancelled { get; set; }

Cancelling stops lower-priority handlers (unless they opt in) and the action itself.

public BlockFace Direction { get; }

The push direction.

public int MovedBlocks { get; }

Number of blocks that move.

public BlockPos Pos { get; }

The piston.

public bool Sticky { get; }

Whether it is a sticky piston.

public World World { get; }

The dimension.

public static ushort CatalogueId { get; }

Catalogue id (stable ABI).

public static bool IsCancellable { get; }

Whether handlers can cancel the event.

public static string Key { get; }

Registry key of the event.

BlockFace · BlockPos · IEvent · World