# JoinServer

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

**Since:** 1.2.7

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

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

```js
new EventJoinServer(LocalPlayer player, String address)
```

Initializes this event with the supplied player and connection address.  
 The player is stored in a [ClientPlayerEntityHelper](../../../../../../../../../classes/com/jsmacrosce/jsmacros/client/api/helper/world/entity/ClientPlayerEntityHelper.md) 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 {#com.jsmacrosce.jsmacros.client.api.event.impl.world.EventJoinServer_address}

```js
address: String
```

Remote address used for the connection.

### player {#com.jsmacrosce.jsmacros.client.api.event.impl.world.EventJoinServer_player}

```js
player: ClientPlayerEntityHelper<LocalPlayer>
```

Local player for this connection.

## Methods

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

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