Minecraft is a gaming world. Or, if you like, a “sandbox.” This is a three dimensional world in which characters do things, all sorts of things. The context for the world of Minecraft is very open ended. The player builds things, moves things, gets things, does things, in a way that makes any one gamer’s game potentially very different from any other gamer’s game.
If you install Minecraft from Minecraft.net (about 30 bucks) and have Python 3, Java, the Minceraft Python API, and a Spigot Minecraft Server, you can program your own versions of the game using Python programming/scripting language.
But how? How do you do that?
Well, you can get Learn to Program with Minecraft: Transform Your World with the Power of Python. This book is intended to teach programming, in the Minecraft setting. The book is designed for kids 10 years and older, though I’m sure some younger kids can use it. Also, it must be admitted that a learning to program book like this may be most valuable for adults who are not coders but want to learn some coding, and happen to be gamers and like Minecraft.
The book, new on the market, provides excellent instructions for setting up all that stuff mentioned above. Everything should work on a Windows machine, on Mac OS X, and Linux.
The programming you do with this book is pretty sophisticated. You learn to create palaces, pyramids, to teleoport players around, to stack blocks, interact with Minecraft’s chat feature, blow stuff up, cast spells, and replicate sections of the Minecraft countryside.
Here is what is interesting about this approach. Python programming is pretty basic, and pretty useful, but one has to do a lot of work to develop something slick and fancy and highly functional (counting working video games or interfaces as highly functional). But working with the existing Minecraft system, via the API, allows some relatively simple programming to produce impressive results. This is “Hello World” on steroids, at the very least.
Of all the diverse No Starch Press programming guides, this one may turn out to be the most effective, as a teaching tools, for that special case where a person is already interested in Minecraft and wants to learn Python.
Here is the Table of Contents:
Chapter 1: Setting Up for Your Adventure
Chapter 2: Teleporting with Variables
Chapter 3: Building Quickly and Traveling Far with Math
Chapter 4: Chatting with Strings
Chapter 5: Figuring Out What’s True and False with Booleans
Chapter 6: Making Mini-Games with if Statements
Chapter 7: Dance Parties and Flower Parades with while Loops
Chapter 8: Functions Give You Superpowers
Chapter 9: Hitting Things with Lists and Dictionaries
Chapter 10: Minecraft Magic with for Loops
Chapter 11: Saving and Loading Buildings with Files and Modules
Chapter 12: Getting Classy with Object-Oriented Programming
Block ID Cheat Sheet
The author, Craig Richardson, is a teacher of Python, former high school computing science teacher, and has been involved with the Raspberry Pi Foundation.