Skip to content

PlayerRespawnEvent

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

public ref struct PlayerRespawnEvent : IEvent

A player is respawning. The destination may be changed.

Id 111
Key mc:player_respawn
Cancellable no
Fired by the engine yes
Field Type Handlers may write Description
Player player no (readonly) The player.
Reason enum:RespawnReason no (readonly) Why.
Position Vec3d yes Where the player appears.
World world yes The dimension the player appears in.
IsSpawnPoint bool no (readonly) True when a bed or respawn anchor of the player is used, false for the world spawn.
Member Description
Constructor Creates the event (for firing it from a plugin; native code builds its own).
public PlayerRespawnEvent(Player player, RespawnReason reason, Vec3d position, World world, bool isSpawnPoint)

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
reason RespawnReason
position Vec3d
world World
isSpawnPoint bool
Member Description
bool IsSpawnPoint { get; } True when a bed or respawn anchor of the player is used, false for the world spawn.
Player Player { get; } The player.
Vec3d Position { get; set; } Where the player appears.
RespawnReason Reason { get; } Why.
World World { get; set; } The dimension the player appears in.
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 IsSpawnPoint { get; }

True when a bed or respawn anchor of the player is used, false for the world spawn.

public Player Player { get; }

The player.

public Vec3d Position { get; set; }

Where the player appears.

public RespawnReason Reason { get; }

Why.

public World World { get; set; }

The dimension the player appears in.

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 · RespawnReason · Vec3d · World