This page describes the interaction algorithm between the Minecraft PE client and server-side components to implement the Realms Alpha functionality
To implement Realms Alpha functionality, you need:
When a player clicks "Login" in the game settings, the authorization process begins.
After successful authentication, redirect the player to your server with the following URL format:
http://site/m/launchmc?accessToken=(PLAYER_TOKEN)&clientToken=(CLIENT_TOKEN)&sessionId=(SESSION_ID)&identity=(IDENTITY)&profileName=(PLAYER_NICKNAME)&profileUuid=(PLAYER_UUID)&email=(EMAIL)&newUser=(true_if_new_player_otherwise_false)
accessToken - Player's access tokenclientToken - Client application tokensessionId - Current session identifieridentity - Player identityprofileName - Player's nicknameprofileUuid - Player's unique identifieremail - Player's email addressnewUser - Boolean indicating if this is a new playerGET /peo/info/statusThe game sends this request on every launch (and possibly after authorization) to check the availability of Realms service.
{
"buyServerEnabled": false,
"createServerEnabled": false,
"serviceEnabled": true
}
buyServerEnabled - If true, players can purchase serverscreateServerEnabled - If true, players can create their own serversserviceEnabled - If true, the Realms button appears in the menu; if false, it doesn'tGET /peo/server/listWhen entering Realms, the game requests the list of available servers.
The response should be a JSON array of server objects with the following structure:
class ServerInfo {
[JsonProperty("id")]
public int ID { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("open")]
public bool IsOpen { get; set; }
[JsonProperty("ownerName")]
public string OwnerName { get; set; }
[JsonProperty("myWorld")]
public bool IsMyRealms { get; set; }
[JsonProperty("maxNrPlayers")]
public int MaxPlayers { get; set; }
[JsonProperty("playerNames")]
public string[] PlayerList { get; set; }
[JsonProperty("type")]
public string RealmsType { get; set; }
[JsonProperty("serverId")]
public int ServerId { get; set; }
[JsonProperty("invited")]
public string[] InvitedPlayers { get; set; }
}
id - Unique server identifiername - Display name of the serveropen - Whether the server is currently accessibleownerName - Name of the server ownermyWorld - Whether this realm belongs to the current playermaxNrPlayers - Maximum number of players allowedplayerNames - Array of currently connected player namestype - Server type (likely "public" for public servers)serverId - Server identifierinvited - Array of invited player namesPOST /refreshThe game sends this request on each game launch to refresh authentication tokens.
{
"accessToken": "token",
"clientToken": "client_token",
"selectedProfile": {
"name": "PlayerNickname"
}
}
POST /peo/server/{server_index}/joinWhen a player clicks to connect to a server, the game sends this request.
server_index - Index of the server in the previously returned server list array{
"ip": "127.0.0.1",
"port": 19132,
"serverId": "0"
}
ip - Server IP address to connect toport - Server port numberserverId - Server identifierThe information provided is based on content written by the user Flusitk (see original file). LegacyMinecraftPE assumes no responsibility for the material presented here or for the files made available.