PlayerRespawnEvent
Namespace Mc.Scripting.Events · Kind struct (ref)
public ref struct PlayerRespawnEvent : IEventA 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. |
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
Constructor |
Creates the event (for firing it from a plugin; native code builds its own). |
Constructor
Section titled “Constructor”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 |
Properties
Section titled “Properties”| 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. |
IsSpawnPoint
Section titled “IsSpawnPoint”public bool IsSpawnPoint { get; }True when a bed or respawn anchor of the player is used, false for the world spawn.
Player
Section titled “Player”public Player Player { get; }The player.
Position
Section titled “Position”public Vec3d Position { get; set; }Where the player appears.
Reason
Section titled “Reason”public RespawnReason Reason { get; }Why.
public World World { get; set; }The dimension the player appears in.
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.
See also
Section titled “See also”IEvent · Player · RespawnReason · Vec3d · World