Skip to content
mc-protocol
Esc
↑↓navigate↵open⌘Jpreview
On this page

Keep Alive (serverbound)

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

// 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

Was this page helpful?