Skip to content

EventHeader

Namespace Mc.Scripting · Kind struct

public struct EventHeader

First field of every event struct (McEventHeader).

The first field of every event struct. Handlers use Cancelled; the other fields are managed by the runtime.

Member Description
byte Flags Flag bits (bit 0 = cancellable).
ushort Id Event type id.
uint Size Size of the full event struct.
public byte Flags;

Flag bits (bit 0 = cancellable).

public ushort Id;

Event type id.

public uint Size;

Size of the full event struct.

Member Description
bool Cancelled { get; set; } Whether a handler cancelled the event (ignored if not cancellable).
bool IsCancellable { get; } Whether the event type can be cancelled.
public bool Cancelled { get; set; }

Whether a handler cancelled the event (ignored if not cancellable).

public bool IsCancellable { get; }

Whether the event type can be cancelled.

Member Description
static EventHeader For<T>() where T : struct, IEvent Creates the header for event type T.
public static EventHeader For<T>() where T : struct, IEvent

Creates the header for event type T.

Returns EventHeader

IEvent