# PlayerList Update

#### Description

This event is triggered when the player list is updated

#### Parameters

```typescript
{ server: IServer, players: IPlayer[], joined: IPlayer[], left: IPlayer[] }
```

#### Example

{% tabs %}
{% tab title="TypeScript" %}

```javascript
import { RCEEvent, type IPlayerListUpdatedEventPayload } from "rce.js";

// ...

rce.on(RCEEvent.PlayerListUpdated, (payload: IPlayerListUpdatedEventPayload) => {
    console.log(`There are ${payload.players.length} in ${payload.server.identifier}!`);
});
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const { RCEEvent } = require("rce.js");

// ...

rce.on(RCEEvent.PlayerListUpdated, (payload) => {
    console.log(`There are ${payload.players.length} in ${payload.server.identifier}!`);
});
```

{% endtab %}
{% endtabs %}
