# PresenceList: change event

> The change event of the PresenceList interface fires when a player's presence entry changes, with the fields that changed.

The **`change`** event of the [`PresenceList`](/docs/client/presence-list) interface fires each time a player's presence entry changes, with the names of the fields that changed.

## Syntax

```ts
addEventListener("change", (event) => {})
```

## Event type

A `PresenceEvent`. It extends `Event` and adds these properties:

`entry` Read only
: The [`PresenceEntry`](/docs/client/presence-entry) that changed.

`changed` Read only
: An array of the fields that changed: any of `"name"`, `"status"` and `"connected"`.

## Description

An entry changes when the room sets a player's name or status with [`Presence.set()`](/docs/room/presence/set), when a player sets their status with [`setStatus()`](/docs/client/presence-list/setstatus), and when `connected` turns `false` as a player's last connection drops, or `true` again as they reconnect within the 10-second grace.

The local player's own `setStatus()` doesn't fire it, since the client's copy changes at once. A correction from the room, replacing the local player's status, does.

After a resync, `change` fires for players who stayed, with whatever changed while the client was away, rather than [`leave`](/docs/client/presence-list/leave-event) and [`join`](/docs/client/presence-list/join-event).

## Examples

### Dimming players who lose connection

The client greys out a player while their connection is down, and shows their status as it changes.

```ts
// roster.ts
import { connect } from "@irtio/client";

const room = await connect("main");

room.presence.addEventListener("change", ({ entry, changed }) => {
  if (changed.includes("connected")) console.log(`${entry.player} ${entry.connected ? "is back" : "lost connection"}`);
  if (changed.includes("status")) console.log(`${entry.player} is now`, entry.status);
});
```

## See also

- [`PresenceList.setStatus()`](/docs/client/presence-list/setstatus)
- [`Presence.set()`](/docs/room/presence/set), the room's side
- [Entry fields](/docs/room/guides/presence#entry-fields)
