Pocket Edition Login

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-&gt;S   ID_UNCONNECTED_PING_OPEN_CONNECTIONS
 * 2) S-&gt;C   ID_UNCONNECTED_PONG

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

Each value is separated by a colon.

An example is:

Connecting
Firstly, you’ll need the RakNet handshake:


 * 1) C-&gt;S   OPEN_CONNECTION_REQUEST_1
 * 2) S-&gt;C   OPEN_CONNECTION_REPLY_1
 * 3) C-&gt;S   OPEN_CONNECTION_REQUEST_2
 * 4) S-&gt;C   OPEN_CONNECTION_REPLY_2
 * 5) C-&gt;S   CLIENT_CONNECT
 * 6) S-&gt;C   SERVER_HANDSHAKE
 * 7) C-&gt;S   CLIENT_HANDSHAKE

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


 * 1) C-&gt;S   GAME_LOGIN
 * 2) S-&gt;C   PLAYER_STATUS of 0
 * 3) S-&gt;C   MOVE_PLAYER (note: entity id of -1)
 * 4) S-&gt;C   START_GAME (note: entity id of -1)
 * 5) S-&gt;C   SET_SPAWN_POSITION
 * 6) S-&gt;C   MOVE_PLAYER (note: entity id of -1)
 * 7) S-&gt;C   SET_TIME
 * 8) S-&gt;C   ADVENTURE_SETTINGS
 * 9) S-&gt;C   RESPAWN
 * 10) C-&gt;S   REQUEST_CHUNK_RADIUS
 * 11) S-&gt;C   CHUNK_RADIUS_UPDATE (optional)
 * 12) S-&gt;C   FULL_CHUNK_DATA (batch packet)
 * 13) S-&gt;C   PLAYER_STATUS of 3
 * 14) S-&gt;C   SET_TIME