Skip to content

PlayerLevelChangeEvent

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

public ref struct PlayerLevelChangeEvent : IEvent

A player’s experience level changed.

Id 128
Key mc:player_level_change
Cancellable no
Fired by the engine yes
Field Type Handlers may write Description
Player player no (readonly) The player.
OldLevel int no (readonly) Level before.
NewLevel int no (readonly) Level after.
Member Description
PlayerLevelChangeEvent(Player player, int oldLevel, int newLevel) Creates the event (for firing it from a plugin; native code builds its own).
public PlayerLevelChangeEvent(Player player, int oldLevel, int newLevel)

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
oldLevel int
newLevel int
Member Description
int NewLevel { get; } Level after.
int OldLevel { get; } Level before.
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.
public int NewLevel { get; }

Level after.

public int OldLevel { get; }

Level before.

public Player Player { get; }

The player.

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