Learn to Program with Minecraft by Craig Richardson

Learn to Program with Minecraft

The very attractive cover does allow you to judge the book!

Publishers link:

https://www.nostarch.com/programwithminecraft

Note: At the time of writing they have 30% off with the code BLOCKPARTY

So…what is this Minecraft thing anyway?

I was very excited to receive a review copy of this book.  You see, like many families Minecraft has slowly infiltrated our lives (or at least the lives of my kids*).  Many a time there are discussions about Creepers, buckets of lava and which house each of the characters are going to be sleeping in.

*However I might “help” from time to time. That’s my story and I’m sticking to it.

For those who have no idea what I am talking about, and have no idea what Minecraft is and why kids will spend hours on it, I’ll “try” to explain…

Minecraft is kind of like a huge virtual Lego(TM) set where you can use the virtual blocks to build and make things.  There are two modes in Minecraft, create mode and survival mode.

Screenshot_2016-01-17-09-30-44

Build whatever you like in your world or perhaps risk sharing your space with your family and find something new appear each day.

Within create mode players (by default called “Steve” or “Alex”) have access to all of the blocks available so they can use and build anything they want to…from cabins in the woods to full cities…to lighthouses and underground hideaways.  Also, in create mode you don’t die…you don’t need to eat, you can fall without harm and walk underwater without breathing (and even fly!).

The survival mode is a little more involved, players have health to keep up which they loose over time, if they fall or run out of breath when underwater.  They have to find food, make tools and avoid monsters (such as Zombies, Creepers or Spiders) which come out at night!  You’ll find you will learn more than you ever wanted to know about it from your kids – apparently it is a hot topic in the playground.

It is a playground to just make or build things in an open environment …and if you are on a network others can join you too** so can become a full family activity.  Although this can cause the odd conflict when there are differences of opinion between the young architects over their carefully imagined creations.

**A word of warning: Ensure you get your settings right as it does default to allowing open access to anyone (including those connected through the internet) and players can send messages to each other when in the same world.

Different Minecraft Editions

Finally, you also need to know…there are several versions available which have slightly different features available.  Unfortunately, this may mean your kid’s favourite method of accessing Minecraft (in our family this was via Android tablets) may not be suitable for use with the examples in the book.

For us, the easiest option was to connect a Raspberry Pi to a TV with a keyboard and mouse.

TIP: Use Alt+TAB to switch between the Minecraft window and Idle3 (the Python editor).  Also, to run your code use F5 (and enter if you’ve not saved, which will confirm the dialogue without using the mouse).

Suitable for use with the book:

Minecraft: PC / MAC Editions – A paid for version of Minecraft which includes everything.  The book provides full instructions on how to install and setup for use with Python (the programming language used in the book).  It does require a little setup.

Minecraft: Pi Edition – Available for free as part of a standard “Raspbian” install on a Raspberry Pi.  This has a very limited set of blocks available compared to the other editions and only the create mode is included.  However, it does support programming using Python right out of the box.  This is the simplest and easiest (and free) method to follow the examples in the book with.  However, you will need a screen directly attached to the Raspberry Pi (rather than remote access).

NOT suitable for use with the book:

These versions do not include support for Python – which is required for the examples given in this particular book.

Minecraft: Pocket Edition (Minecraft PE) – This is a paid for application for Android and iOS devices.  It includes Create and Survival modes, but does not include all of the blocks available in the other editions.

Minecraft: XBox / Playstation Editions – Another paid for version of Minecraft.  I believe this has all the blocks and both modes of game play (however I’ve not used it).

Quick start

As mentioned, we used the Raspberry Pi to try out the book which meant we were up and running within a few minutes.  The book includes a whole section on setting everything up for Windows/MAC/Raspberry Pi and what to do if it does’t go as it should.

IMG_20160116_200201

Minecraft on the Raspberry Pi – a small keyboard and mouse is ideal for smaller hands!

On the Raspberry Pi it is as simple as running the following with Python3:

 

from mcpi.minecraft import Minecraft

mc = Minecraft.create()

mc.postToChat(“Hello Minecraft World”)

 

Then we get started with the “Missions” which are bite-size examples each small enough to provide a little bit of extra knowledge while keeping the attention of the reader.  The book includes over 70 missions and cover a huge amount of Minecraft related tasks while all the time feeding in layers of Python skills without the reader noticing.

Each mission carefully guides the reader through each step, explaining how it works and why along with some ideas to extend and explore further.

Inspiring

I really love books like this, because they feed upon the interests and enthusiasm which are already present (ask any child which plays Minecraft and you’ll just see how involved they get) and builds upon it.

There is a strong following of using Minecraft for Raspberry Pi/Python workshops and has proved to be exceptionally popular at most Raspberry Pi “Jams”.

As you can imagine, hooking their interest is easy when half the battle is done and I can imagine they’ll be discussing the finer points of Python alongside their Creeper/Craft table break time chats.

There just one small drawback…it can be a little tricky to get the kids to focus as at the end of the day Minecraft is a game, so it can be a challenge to get them to switch from going off and building their own things to following through a book.  A tip I’ve seen in workshops…is “hands must in the air while instructions are being given”.

Suitability

This is rather more difficult to suggest who this book would work well for.

I think for younger ages (~7/8 years) addition help and guidance may be needed (an adult reading ahead and talking them through it may help, and taking on some of the typing when needed).

Older age groups should be more than comfortable following through the examples on their own with far less assistance and since each “mission” focuses on a specific action they will  progress quickly through the book.

Of course not everything suits everyone, so don’t be disappointed if this isn’t the spark that ignites that inner programmer in your child immediately.  The beauty of Minecraft is that is so open and unrestricted, tying it down to a textual / structured programming language may not be suitable for all…or you may just have to re-visit it after you’ve introduced the idea (sometimes it takes time for these strange idea’s to sink in).

Makes it easy…

We managed to breeze through to mission 11 in an afternoon with my 8 year old assistant!  There is a huge amount of detail supporting these and they quickly introduce the base concepts of programming as you go (so if you are an adult with no programming experience you will be able to learn a few things too).