Skip to content

PortalCreateEvent

Namespace Mc.Scripting.Events · Kind struct (ref)

public ref struct PortalCreateEvent : IEvent

A 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.

Member Description
PortalCreateEvent(World world, PortalCreateReason reason, int blockCount) Creates the event (for firing it from a plugin; native code builds its own).
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
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.
public int BlockCount { get; }

Portal blocks created.

public bool Cancelled { get; set; }

Cancelling stops lower-priority handlers (unless they opt in) and the action itself.

public PortalCreateReason Reason { get; }

Why.

public World World { get; }

The dimension.

public static ushort CatalogueId { get; }

Catalogue id (stable ABI).

public static bool IsCancellable { get; }

Whether handlers can cancel the event.

public static string Key { get; }

Registry key of the event.

IEvent · PortalCreateReason · World