BlockSpreadEvent
Namespace Mc.Scripting.Events · Kind struct (ref)
public ref struct BlockSpreadEvent : IEventA block is spreading to a neighbour (grass, mycelium, vines, fire). Cancel to stop it.
| Id | 183 |
| Key | mc:block_spread |
| Cancellable | yes |
| Fired by the engine | yes |
| Field | Type | Handlers may write | Description |
|---|---|---|---|
World |
world |
no (readonly) | The dimension. |
Pos |
BlockPos |
no (readonly) | The target position. |
Source |
BlockPos |
no (readonly) | The spreading block. |
NewState |
blockstate |
no (readonly) | The state that would be placed. |
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 |
|---|---|
BlockSpreadEvent(World world, BlockPos pos, BlockPos source, BlockState newState) |
Creates the event (for firing it from a plugin; native code builds its own). |
Constructor
Section titled “Constructor”public BlockSpreadEvent(World world, BlockPos pos, BlockPos source, BlockState newState)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 |
|
source |
BlockPos |
|
newState |
BlockState |
Properties
Section titled “Properties”| Member | Description |
|---|---|
bool Cancelled { get; set; } |
Cancelling stops lower-priority handlers (unless they opt in) and the action itself. |
BlockState NewState { get; } |
The state that would be placed. |
BlockPos Pos { get; } |
The target position. |
BlockPos Source { get; } |
The spreading block. |
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.
NewState
Section titled “NewState”public BlockState NewState { get; }The state that would be placed.
public BlockPos Pos { get; }The target position.
Source
Section titled “Source”public BlockPos Source { get; }The spreading block.
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.
See also
Section titled “See also”BlockPos · BlockState · IEvent · World