Skip to content

JoinServer ​

com.jsmacrosce.jsmacros.client.api.event.impl.world.EventJoinServer

Since1.2.7Not cancellable

Fires after the login packet is handled and the local player exists; the world may still be loading.

js
JsMacros.on("JoinServer", JavaWrapper.methodToJava(function (event) {
  Chat.log(`Joined ${event.address} as ${event.player.getName().getString()}`);  
}))

Constructors ​

new EventJoinServer ​

new EventJoinServer(LocalPlayer player, String address)#
Initializes this event with the supplied player and connection address. The player is stored in a ClientPlayerEntityHelper wrapper, including when player is null; the address is stored unchanged. This constructor does not perform connection setup or dispatch the event.

Parameters:

  • player: the local player to wrap; null is retained by the wrapper
  • address: the supplied connection address, stored unchanged and possibly null

Fields ​

address ​

address: Stringread-only#
Remote address used for the connection.

player ​

Local player for this connection.

Methods ​

toString ​

toString(): String#
Returns a diagnostic string containing the event name and address. The address is interpolated as a quoted string without escaping; a null address therefore appears as the text "null". This is not a JSON serializer.
Returns: the event name followed by :{"address": "..."}, with the supplied address inserted between the quotes