Skip to content

PlayerToggleSprintEvent

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

public ref struct PlayerToggleSprintEvent : IEvent

A player started or stopped sprinting. Cancel to ignore the change.

Id 121
Key mc:player_toggle_sprint
Cancellable yes
Fired by the engine yes
Field Type Handlers may write Description
Player player no (readonly) The player.
Sprinting bool no (readonly) The new sprinting state.

Set e.Cancelled = true in a handler to cancel it; lower-priority handlers are skipped unless they subscribed with receiveCancelled: true.

Member Description
PlayerToggleSprintEvent(Player player, bool sprinting) Creates the event (for firing it from a plugin; native code builds its own).
public PlayerToggleSprintEvent(Player player, bool sprinting)

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
sprinting bool
Member Description
bool Cancelled { get; set; } Cancelling stops lower-priority handlers (unless they opt in) and the action itself.
Player Player { get; } The player.
bool Sprinting { get; } The new sprinting state.
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 bool Cancelled { get; set; }

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

public Player Player { get; }

The player.

public bool Sprinting { get; }

The new sprinting state.

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 · Player