Keep Alive (serverbound)
Play 0x1C, client → server.
play · 0x1C · serverbound (client → server)
Response to a clientbound KeepAlive. keepAliveId must match the id the server sent. The server disconnects the client if no matching reply arrives within about 30 seconds; it also uses the round-trip time for the player’s latency.
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
client.on("KeepAlive", async (data) => {
await client.sendPacket("KeepAlive", { keepAliveId: data.keepAliveId });
});
Echo the ID from the server’s KeepAlive unchanged. The vanilla server kicks a client that answers with the wrong ID or does not answer in time.
Field aliases listed under Notes are accepted as alternative keys when writing.
Source: src/Core/Versions/776/Packets/play/serverbound/KeepAlive.ts