Skip to content

PlayerJoinEvent

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

public ref struct PlayerJoinEvent : IEvent

A player entity entered the play state. The join message is broadcast after the handlers ran.

Id 11
Key mc:player_join
Cancellable no
Fired by the engine yes
Field Type Handlers may write Description
Player player no (readonly) The player.
Uuid Uuid no (readonly) The profile id.
Username Utf8String no (readonly) The profile name.
JoinMessage component yes The message broadcast to everybody (set to an empty component to suppress it).
Member Description
PlayerJoinEvent(Player player, Uuid uuid, Utf8String username, Utf8String joinMessage) Creates the event (for firing it from a plugin; native code builds its own).
public PlayerJoinEvent(Player player, Uuid uuid, Utf8String username, Utf8String joinMessage)

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
uuid Uuid
username Utf8String
joinMessage Utf8String
Member Description
Component JoinMessage { get; } The message broadcast to everybody (set to an empty component to suppress it).
Utf8String JoinMessageJson { get; } The message broadcast to everybody (set to an empty component to suppress it).
Player Player { get; } The player.
Utf8String Username { get; } The profile name.
Uuid Uuid { get; } The profile id.
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 Component JoinMessage { get; }

The message broadcast to everybody (set to an empty component to suppress it). (parsed on access; allocates).

public Utf8String JoinMessageJson { get; }

The message broadcast to everybody (set to an empty component to suppress it). as JSON text (borrowed).

public Player Player { get; }

The player.

public Utf8String Username { get; }

The profile name.

public Uuid Uuid { get; }

The profile id.

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.

Member Description
void SetJoinMessage(Component value) Replaces PlayerJoinEvent.JoinMessage; an empty component clears it where the event says so.
public void SetJoinMessage(Component value)

Replaces PlayerJoinEvent.JoinMessage; an empty component clears it where the event says so.

Parameters

Name Type Description
value Component

Component · IEvent · Player · Utf8String · Uuid