Created
February 11, 2017 18:46
-
-
Save jocopa3/54b42fb6361952997c4a6e38945e306f to your computer and use it in GitHub Desktop.
MCPE/Win10 WebSocket JSON Messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For more information about available commands, look at the commands/standard.json file in the game's assets. | |
{ | |
"body": { | |
"input": {}, // Command inputs go here | |
"origin": { | |
"type": "player" // Where the command originates from | |
}, | |
"name": "name-of-command", // Command name goes here (i.e. for /say, enter "say") | |
"version": 1, | |
"overload": "default" // If the command has additional overloads defined, you can specify it here | |
}, | |
"header": { | |
"requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | |
"messagePurpose": "commandRequest", // Note that both messagePurpose and messageType are "commandRequest" | |
"version": 1, | |
"messageType": "commandRequest" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: the body for this command usually has extra data, but that data looks different for each command | |
{ | |
"body": { | |
"statusCode": 0, // Whether the command executed successfully, or if an error occured | |
"statusMessage": "response message" // Some command reponses may not have a status message | |
}, | |
"header": { | |
"messagePurpose": "commandResponse", // Notice there is no messageType | |
"requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | |
"version": 1 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"body": { | |
"statusMessage": "", // Indicates what the error is | |
"statusCode": -2147483647 // Indicates the error type | |
}, | |
"header": { | |
"messagePurpose": "error", // Notice there is no messageType | |
"requestId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | |
"version": 1 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"body": { | |
"eventName": "name-of-event", // The name of the event being responded to | |
"measurements": null, // No idea what this does... | |
"properties": { // Additional details about the event and client | |
} | |
}, | |
"header": { | |
"messagePurpose": "event", // Notice there is no messageType | |
"requestId": "00000000-0000-0000-0000-000000000000", // UUID always seems to be all zeros | |
"version": 1 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To see a list of known event names, look at: https://gist.github.com/jocopa3/5f718f4198f1ea91a37e3a9da468675c | |
{ | |
"body": { | |
"eventName": "NameOfEvent" // Event to subscribe to | |
}, | |
"header": { | |
"requestId": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx", | |
"messagePurpose": "subscribe", // Notice that messagePurpose is different from messageType | |
"version": 1, | |
"messageType": "commandRequest" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To see a list of known event names, look at: https://gist.github.com/jocopa3/5f718f4198f1ea91a37e3a9da468675c | |
{ | |
"body": { | |
"eventName": "NameOfEvent" // Event to unsubscribe to | |
}, | |
"header": { | |
"requestId": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx", | |
"messagePurpose": "unsubscribe", // Notice that messagePurpose is different from messageType | |
"version": 1, | |
"messageType": "commandRequest" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment