# LaunchGame

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

**Since:** 1.8.4

**Cancellable:** No. Calling `event.cancel()` throws `UnsupportedOperationException`.

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 {#com.jsmacrosce.jsmacros.client.api.event.impl.EventLaunchGame_constructor-String-}

```js
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 {#com.jsmacrosce.jsmacros.client.api.event.impl.EventLaunchGame_playerName}

```js
playerName: String
```

The name from the client session, captured when the client's `run` method starts.

## Methods

### toString {#com.jsmacrosce.jsmacros.client.api.event.impl.EventLaunchGame_toString-}

```js
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
