BlockRedstoneEvent
Namespace Mc.Scripting.Events · Kind struct (ref)
public ref struct BlockRedstoneEvent : IEventA redstone component’s output power changes. The new power may be changed.
| Id | 189 |
| Key | mc:block_redstone |
| Cancellable | no |
| Fired by the engine | yes |
| Field | Type | Handlers may write | Description |
|---|---|---|---|
World |
world |
no (readonly) | The dimension. |
Pos |
BlockPos |
no (readonly) | The block. |
OldPower |
int |
no (readonly) | Power before (0-15). |
NewPower |
int |
yes | Power after (0-15). |
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
BlockRedstoneEvent(World world, BlockPos pos, int oldPower, int newPower) |
Creates the event (for firing it from a plugin; native code builds its own). |
Constructor
Section titled “Constructor”public BlockRedstoneEvent(World world, BlockPos pos, int oldPower, int newPower)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 |
|
oldPower |
int |
|
newPower |
int |
Properties
Section titled “Properties”| Member | Description |
|---|---|
int NewPower { get; set; } |
Power after (0-15). |
int OldPower { get; } |
Power before (0-15). |
BlockPos Pos { get; } |
The 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. |
NewPower
Section titled “NewPower”public int NewPower { get; set; }Power after (0-15).
OldPower
Section titled “OldPower”public int OldPower { get; }Power before (0-15).
public BlockPos Pos { get; }The 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.