Back in the day, making a Minecraft mod was…challenging. It was a series of JAR files and Java hacks and deep folder structures. It was possible, but it wasn’t fun and it surely wasn’t easy. I wanted to revisit things now that Minecraft is easily installed from the Windows Store.
I headed over to https://minecraft.makecode.com/setup/minecraft-windows10 and followed the instructions. I already have Minecraft installed, so I just had to install the Minecraft Code Connection app. The architecture here is very clean and clever. Basically you turn on cheats in Minecraft and use a local websockets connection between the Code Connection app and Minecraft – you’re automating Minecraft from an external application!
Here I’m turning on cheats in a new Miencraft world:
Then from the Code Connection app, I get a URL for the automation server, then go back to Minecraft, hit “t” and paste it in the URL. Now the two apps are talking to each other.
Then an editor opens. This is the same base open source Make Code editor I used when I was coding for an Adafruit Circuit Playground Express earlier this year.
Now, I’ll setup a chat command in Make Code that makes it rain chickens when I type the chat command “chicken.” It runs a loop and spawns 100 chickens 10 blocks above my character’s head.
I was really surprised how easy this was. It was maybe 10 mins end to end, which is WAY easier than the Java add-ins I learned about just a few years ago.
There are a ton of tutorials here, including Chicken Rain. https://minecraft.makecode.com/tutorials
The one I’m most excited to show my kids is the Agent. Your connection to the remote Code Connection app includes an avatar or “agent.” Just like Logo (remember that, robot turtles?) you can control your agent and make him build stuff. No more tedious house building for us! Let’s for-loop our way to glory and teach dude how to make us a castle!