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

Ping Request

Status 0x01, client → server.

status · 0x01 · serverbound (client → server)

Sent by the client after StatusResponse to measure latency. time is an arbitrary client timestamp. The server must echo the same value back in PongResponse, after which the connection is closed.

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

Fields

Field Type Notes
time Long also timestamp

Send it

// Client side, after receiving StatusResponse.
const sentAt = BigInt(Date.now());
await client.sendPacket("PingRequest", {
  time: sentAt,
});

time may be any signed 64-bit value. Save it if you want to calculate latency; the server must return it unchanged in PongResponse. timestamp is accepted as an alias when writing.

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

Source: src/Core/Versions/776/Packets/status/serverbound/PingRequest.ts

Was this page helpful?