PlayerToggleFlightEvent
Namespace Mc.Scripting.Events · Kind struct (ref)
public ref struct PlayerToggleFlightEvent : IEventA player started or stopped flying (creative / may-fly). Cancel to ignore the change.
| Id | 122 |
| Key | mc:player_toggle_flight |
| Cancellable | yes |
| Fired by the engine | yes |
| Field | Type | Handlers may write | Description |
|---|---|---|---|
Player |
player |
no (readonly) | The player. |
Flying |
bool |
no (readonly) | The new flying state. |
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 |
|---|---|
PlayerToggleFlightEvent(Player player, bool flying) |
Creates the event (for firing it from a plugin; native code builds its own). |
Constructor
Section titled “Constructor”public PlayerToggleFlightEvent(Player player, bool flying)Creates the event (for firing it from a plugin; native code builds its own). Signature of API 1.0.
Parameters
| Name | Type | Description |
|---|---|---|
player |
Player |
|
flying |
bool |
Properties
Section titled “Properties”| Member | Description |
|---|---|
bool Cancelled { get; set; } |
Cancelling stops lower-priority handlers (unless they opt in) and the action itself. |
bool Flying { get; } |
The new flying state. |
Player Player { get; } |
The player. |
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.
Flying
Section titled “Flying”public bool Flying { get; }The new flying state.
Player
Section titled “Player”public Player Player { get; }The player.
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.