Skip to content

LaunchGame ​

com.jsmacrosce.jsmacros.client.api.event.impl.EventLaunchGame

Since1.8.4Not cancellable

Fires at the head of the client's run method and provides the client session's name.

js
JsMacros.on("LaunchGame", JavaWrapper.methodToJava(function (event) {
  Chat.log(`client starting as ${event.playerName}`);  
}))

Constructors ​

new EventLaunchGame ​

new EventLaunchGame(String playerName)#
Sets this event's runner to the client core and stores the supplied name without validation. Construction does not trigger or dispatch the event.

Parameters:

  • playerName: the supplied player name; no session lookup is performed

Fields ​

playerName ​

playerName: Stringread-only#
The name from the client session, captured when the client's run method starts.

Methods ​

toString ​

toString(): String#
Formats a diagnostic string as %s:{"name": "%s"}, using the event name and supplied player name. The name is not escaped, so this output is not necessarily valid JSON.
Returns: the diagnostic string containing the event name and supplied player name