PortalCreateEvent
Namespace Mc.Scripting.Events · Kind struct (ref)
public ref struct PortalCreateEvent : IEventA nether portal frame is about to be filled or a destination portal built. Cancel to prevent it.
| Id | 303 |
| Key | mc:portal_create |
| Cancellable | yes |
| Fired by the engine | yes |
| Field | Type | Handlers may write | Description |
|---|---|---|---|
World |
world |
no (readonly) | The dimension. |
Reason |
enum:PortalCreateReason |
no (readonly) | Why. |
BlockCount |
int |
no (readonly) | Portal blocks created. |
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 |
|---|---|
PortalCreateEvent(World world, PortalCreateReason reason, int blockCount) |
Creates the event (for firing it from a plugin; native code builds its own). |
Constructor
Section titled “Constructor”public PortalCreateEvent(World world, PortalCreateReason reason, int blockCount)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 |
|
reason |
PortalCreateReason |
|
blockCount |
int |
Properties
Section titled “Properties”| Member | Description |
|---|---|
int BlockCount { get; } |
Portal blocks created. |
bool Cancelled { get; set; } |
Cancelling stops lower-priority handlers (unless they opt in) and the action itself. |
PortalCreateReason Reason { get; } |
Why. |
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. |
BlockCount
Section titled “BlockCount”public int BlockCount { get; }Portal blocks created.
Cancelled
Section titled “Cancelled”public bool Cancelled { get; set; }Cancelling stops lower-priority handlers (unless they opt in) and the action itself.
Reason
Section titled “Reason”public PortalCreateReason Reason { get; }Why.
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.