PlayerJoinEvent
Namespace Mc.Scripting.Events · Kind struct (ref)
public ref struct PlayerJoinEvent : IEventA 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). |
Constructors
Section titled “Constructors”| 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). |
Constructor
Section titled “Constructor”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 |
Properties
Section titled “Properties”| 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. |
JoinMessage
Section titled “JoinMessage”public Component JoinMessage { get; }The message broadcast to everybody (set to an empty component to suppress it). (parsed on access; allocates).
JoinMessageJson
Section titled “JoinMessageJson”public Utf8String JoinMessageJson { get; }The message broadcast to everybody (set to an empty component to suppress it). as JSON text (borrowed).
Player
Section titled “Player”public Player Player { get; }The player.
Username
Section titled “Username”public Utf8String Username { get; }The profile name.
public Uuid Uuid { get; }The profile id.
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.
Methods
Section titled “Methods”| Member | Description |
|---|---|
void SetJoinMessage(Component value) |
Replaces PlayerJoinEvent.JoinMessage; an empty component clears it where the event says so. |
SetJoinMessage
Section titled “SetJoinMessage”public void SetJoinMessage(Component value)Replaces PlayerJoinEvent.JoinMessage; an empty component clears it where the event says so.
Parameters
| Name | Type | Description |
|---|---|---|
value |
Component |
See also
Section titled “See also”Component · IEvent · Player · Utf8String · Uuid