---
title: Keep Alive (serverbound)
description: "Configuration 0x04, client → server."
---

`config` · `0x04` · **serverbound** (client → server)

Response to a clientbound `KeepAlive` during configuration. `keepAliveId` must match the id the server sent. The server disconnects the client if no matching reply arrives within the timeout.

Sent by the client, read by the server. Listen for it with `client.on("KeepAlive", (data) => …)` on the receiving side.

## Fields

| Field | Type | Notes |
|---|---|---|
| `keepAliveId` | Long | also `id` |

## Send it

```ts
// Client side, echo the server's KeepAlive id.
client.on("KeepAlive", async (data) => {
  await client.sendPacket("KeepAlive", {
    keepAliveId: data.id,
  });
});
```

Echo the parsed `id` exactly and promptly. `keepAliveId` is a signed 64-bit value; `id` is also accepted as a write alias.

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: [`src/Core/Versions/776/Packets/config/serverbound/KeepAlive.ts`](https://github.com/GDLev/mc-protocol/blob/master/src/Core/Versions/776/Packets/config/serverbound/KeepAlive.ts)
