An API that utilizes Minecraft Bedrock Edition's (and Minecraft Education Edition's) websocket capabilities to administer commands and listen to in-game events.
This API is a wrapper for Minecraft Bedrock Edition's (and Minecraft Education Edition's) websocket capabilities. It allows you to send commands to the server and listen to events that happen in-game. I'm going further with this and implementing a REST API into the websocket server. This will abstract the websocket protocol and allow you to use the API as if it were a REST API. REST API event callbacks require a callback URL and a listening webserver.
The websocket connects through your client, and the program will share your in-game permissions. This means that you can't use this API to send commands in a game that you're not an admin in.
You need to disable encrypted web sockets for this to work. There's no way in hell that I'm actually going to implement the monstrosity that is com.microsoft.minecraft.wsencrypt
. You can find this setting under Settings
-> General
-> Require Encrypted Websockets
.
Note: for some reason on servers you can't run the command from the console, or from in-game. Feel free to submit a PR if you know a workaround.
/connect ws://localhost:8080/ws/someid
POST /cmd/{id}
JSON body:
{
"cmd": "say Hello World"
}
POST /api/event/{id}/{eventName}
DELETE /api/event/{id}/{eventName}
https://gist.github.com/jocopa3/5f718f4198f1ea91a37e3a9da468675c
https://gist.github.com/jocopa3/54b42fb6361952997c4a6e38945e306f
https://gist.github.com/pirosuke/1ca2aa4d8920f41dfbabcbc7dc2a669f
https://github.com/Sandertv/mcwss/
https://github.com/Nathan-Nesbitt/Minecraft_API
https://github.com/askvictor/mineclass