Skip to content

Instantly share code, notes, and snippets.

@alejzeis
Last active August 29, 2015 14:06
Show Gist options
  • Save alejzeis/61271d9241f181f0c0f9 to your computer and use it in GitHub Desktop.
Save alejzeis/61271d9241f181f0c0f9 to your computer and use it in GitHub Desktop.
Login sequence for MCPC

Login Sequence:

0. Packet format:

First comes a VarInt of the packet's length (in bytes). Then there is the 1 byte packet ID, and finally the payload.

1. Handshake packet:

First of all, a handshake packet must be sent:

Field Example Field Type Length
Packet ID 0x00 Byte 1 byte
Protocol Version 47 VarInt Depends
Server Address localhost String Depends
Server Port 25565 Unsigned Short 2 bytes
Next State 1 VarInt Depends

The "Next State" field comes in two forms: 1 is for status ping, 2 is for login.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment