PlayerLeave
com.jsmacrosce.jsmacros.client.api.event.impl.world.EventPlayerLeave
Fired when a matching player-list entry is removed from the client player list.
js
JsMacros.on("PlayerLeave", JavaWrapper.methodToJava(function (event) {
const name = event.player.getName();
Chat.log(`${name === null ? event.UUID : name} left the player list`);
}))Constructors
new EventPlayerLeave
new EventPlayerLeave(UUID uuid, PlayerInfo player)#Captures the UUID string and wraps the removed player-list entry for this event payload. A
null UUID throws NullPointerException before the entry is wrapped. The arguments are required to be non-null; a null player violates that precondition and is retained as a null entry inside the helper. This constructor does not itself remove an entry, disconnect a player, or dispatch the event.Parameters:
uuid: the required identifier whose string form is captured independently of the entryplayer: the required player-list entry to wrap
Fields
player
The removed player-list entry.
UUID
Methods
toString
Returns a diagnostic representation containing the event name and the current helper representation of player; it is not a JSON serialization or a rendering of the separately captured UUID field. If the helper wraps a null entry, its representation throws NullPointerException while accessing that entry.
Returns: the event name and helper representation in the form
%s:{"player": %s}