Pocket Edition Login

From wiki.vg
Revision as of 09:34, 16 August 2016 by Boredphoton (talk | contribs) (Added CLIENT_HANDSHAKE)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This article describes the 0.14.3 login sequence in Minecraft: PE

The recommended login sequence and ping sequence looks like this, where C is the client and S is the server:

Pinging

  1. C->S 0x01 ID_UNCONNECTED_PING_OPEN_CONNECTIONS
  2. S->C 0x1C ID_UNCONNECTED_PONG

Note that the servername field in the ID_UNCONNECTED_PONG follows a specific format for MCPE as described below:

Field Name Field Value Notes
Prefix MCPE
Server Name The MOTD of your server Can also include any MCPE colors
Protocol Number Represented as ‘10 10’ if 10 was the current number Must be the minor major separated by a space
The Text Version A string that is shown to the player, must be MAJOR.MINOR.PATCH The protocol number affects if the client rejects the connection or not, this can have any value
Online Players A number of online players
Max Players A number of max players

Each value is separated by a colon.
An example is: MCPE;A Minecraft: PE Server;70 70;0.14.3;0;20

Connecting

Firstly, you’ll need the RakNet handshake:

  1. C->S 0x05 OPEN_CONNECTION_REQUEST_1
  2. S->C 0x06 OPEN_CONNECTION_REPLY_1
  3. C->S 0x07 OPEN_CONNECTION_REQUEST_2
  4. S->C 0x08 OPEN_CONNECTION_REPLY_2
  5. C->S 0x09 CLIENT_CONNECT
  6. S->C 0x10 SERVER_HANDSHAKE
  7. C->S 0x13 CLIENT_HANDSHAKE

Then you may start pinging the client and get ready for login, once you have finished the RakNet handshake:

  1. C->S 0x8f GAME_LOGIN
  2. S->C 0x90 PLAYER_STATUS of 0
  3. S->C 0x9d MOVE_PLAYER (note: entity id of -1)
  4. S->C 0x95 START_GAME (note: entity id of -1)
  5. S->C 0xb1 SET_SPAWN_POSITION
  6. S->C 0x9d MOVE_PLAYER (note: entity id of -1)
  7. S->C 0x94 SET_TIME
  8. S->C 0xbc ADVENTURE_SETTINGS
  9. S->C 0xb3 RESPAWN
  10. C->S 0xc8 REQUEST_CHUNK_RADIUS
  11. S->C 0xc9 CHUNK_RADIUS_UPDATE (optional)
  12. S->C 0xbf FULL_CHUNK_DATA (batch packet)
  13. S->C 0x90 PLAYER_STATUS of 3
  14. S->C 0x94 SET_TIME