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

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 Server sends clientbound packets and receives serverbound ones. A Client does the reverse.
  • Names. Pass the packet name to client.sendPacket(name, data) and listen with client.on(name, handler). Names follow the vanilla server’s class names, so Intension is the handshake and Hello is login start.
  • Aliases. Some fields accept a second key when writing (for example protocol for protocolVersion). The alias column lists them.
  • State. Sending a packet from the wrong state throws Unknown packet: state/bound/name before anything is written.

Was this page helpful?