BlockPistonRetractEvent
Namespace Mc.Scripting.Events · Kind struct (ref)
public ref struct BlockPistonRetractEvent : IEventA piston is about to retract. Cancel to keep it extended.
| Id | 188 |
| Key | mc:block_piston_retract |
| 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.
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
Constructor |
Creates the event (for firing it from a plugin; native code builds its own). |
Constructor
Section titled “Constructor”public BlockPistonRetractEvent(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 |
Properties
Section titled “Properties”| 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. |
Cancelled
Section titled “Cancelled”public bool Cancelled { get; set; }Cancelling stops lower-priority handlers (unless they opt in) and the action itself.
Direction
Section titled “Direction”public BlockFace Direction { get; }The push direction.
MovedBlocks
Section titled “MovedBlocks”public int MovedBlocks { get; }Number of blocks that move.
public BlockPos Pos { get; }The piston.
Sticky
Section titled “Sticky”public bool Sticky { get; }Whether it is a sticky piston.
public World World { get; }The dimension.
CatalogueId
Section titled “CatalogueId”public static ushort CatalogueId { get; }Catalogue id (stable ABI).
IsCancellable
Section titled “IsCancellable”public static bool IsCancellable { get; }Whether handlers can cancel the event.
public static string Key { get; }Registry key of the event.