Packets
Every packet mc-protocol can read and write, by connection state.
257 packets for Minecraft 26.2, generated from the packet definitions in src/Core/Versions/776/Packets. Every one has read() and write().
| State | Packets | |
|---|---|---|
| Handshake | 2 | The first packet on a new socket. Nothing is sent back. |
| Status | 4 | Server list ping. The client closes the socket when done. |
| Login | 11 | Identity, optional encryption, and the compression threshold. |
| Configuration | 30 | Registries, tags, feature flags and resource packs before the world. |
| Play | 210 | Everything in the world: chunks, entities, chat, movement. |
How to read these pages
- Direction. Serverbound is client → server; clientbound is server → client. A
Serversends clientbound packets and receives serverbound ones. AClientdoes the reverse. - Names. Pass the packet name to
client.sendPacket(name, data)and listen withclient.on(name, handler). Names follow the vanilla server’s class names, soIntensionis the handshake andHellois login start. - Aliases. Some fields accept a second key when writing (for example
protocolforprotocolVersion). The alias column lists them. - State. Sending a packet from the wrong state throws
Unknown packet: state/bound/namebefore anything is written.