Status
Clientbound (Client → Server)
0x00 Server Status Response Packet
This packet is sent from the server to the client to provide the current status of the server. It includes information such as the server's version, player count, and other relevant details.
| Field | Display Name | Type | Notes |
|---|---|---|---|
| status | Server Status | ServerStatus | This field contains the server's status information, which is serialized and deserialized using a JSON codec. |
| STREAM_CODEC | Stream Codec | StreamCodec<FriendlyByteBuf ClientboundStatusResponsePacket> | This is a codec used for encoding and decoding the packet data to and from the byte buffer. |
0x01 Pong Response Packet
This packet is sent from the server to the client as a response to a ping request, containing the timestamp of when the ping was sent.
| Field | Display Name | Type | Notes |
|---|---|---|---|
| time | Timestamp | long | The timestamp in milliseconds when the ping request was originally sent. This is used to calculate the round-trip time for the ping. |
Serverbound (Server → Client)
0x00 Server Status Request Packet
This packet is sent by the client to request the current status of the server. It is part of the server status protocol and is used to initiate a status query.
| Field | Display Name | Type | Notes |
|---|---|---|---|
| INSTANCE | Singleton Instance | ServerboundStatusRequestPacket | A singleton instance of the ServerboundStatusRequestPacket, used to avoid creating multiple instances of the same packet. |
| STREAM_CODEC | Stream Codec | StreamCodec<ByteBuf ServerboundStatusRequestPacket> | A codec for encoding and decoding the ServerboundStatusRequestPacket. It uses a unit codec since the packet has no fields. |
0x01 Ping Request Packet
This packet is used to send a ping request from the client to the server, allowing the server to measure the round-trip time and respond accordingly.
| Field | Display Name | Type | Notes |
|---|---|---|---|
| time | Timestamp | long | The timestamp when the ping request was sent. This is used to calculate the latency between the client and server. |