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

Cookie Response

Configuration 0x01, client → server.

config · 0x01 · serverbound (client → server)

Reply to a CookieRequest sent in the configuration state. It carries the cookie key and the stored payload, or no payload if the client has none.

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

Fields

Field Type Notes
key String
value Optional also payload

Send it

// Client side, in reply to CookieRequest.
client.on("CookieRequest", async (data) => {
  await client.sendPacket("CookieResponse", {
    key: data.key,
    value: null, // no stored value for this key
  });
});

Return the exact requested key. Set value to a Buffer (up to 5120 bytes) when the cookie exists, or null when it does not; payload is accepted as an alias.

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

Source: src/Core/Versions/776/Packets/config/serverbound/CookieResponse.ts

Was this page helpful?