Thursday, September 24, 2015

Visual programming for Minecraft

One of my hobbies is computer science education for children. Over the past year or so, I've been developing Raspberry Jam Mod (requires Forge and Minecraft 1.8), a Minecraft mod that implements the Raspberry Pi Minecraft API and allows one to write Python code that connects with Minecraft (this isn't that original: there are two other projects that do that). I taught some Python to gifted middle- and high-schoolers in the summer using this setup.

Over the last couple of days, I decided it would be nice to make something like this available for younger kids, using Google's Blockly graphical programming environment in place of Python. It's nothing very sophisticated, but you can use 3D turtle graphics commands to draw stuff in Minecraft. If interested, install Forge for Minecraft 1.8, then Raspberry Jam Mod version 0.50 or higher, start a single-user Minecraft world, and point your browser to to get the Blockly code editor in-browser. The in-browser Blockly editor should then talk to your Minecraft.

Source code for the Blockly stuff is here.


Alexander R Pruss said...

You can now also do this with Minetest, which is free. Just drop the raspberryjammod folder from Raspberry Jam Mod for Minetest into the mods folder of Minetest. (Currently, Windows-only, and not compatible with the mingw builds of Minetest.

This should be nice for school activities where the school doesn't want to buy a bunch of Minecraft licenses. Minetest is more limited than Minecraft (at least with the stock package), but it is free, and it seems to run a lot better on older hardware than Minecraft does, which is a bonus for educational use.

Shyam said...

Hi Alexander,

I tried it for Minetest. But when starting the game by selecting the mod, then it says,
'ModError: Failed to load and run script from C:\Users\Admin\Desktop\minecraft_server\minetest-0.4.15-win64\minetest-0.4.15-win64\bin\..\mods\raspberryjammod\init.lua:
: error loading module 'socket.cx64' from file 'C:\Users\Admin\Desktop\minecraft_server\minetest-0.4.15-win64\minetest-0.4.15-win64\bin\..\mods\raspberryjammod\socket\cx64.dll':
: The specified module could not be found.'

Could you please help me out?

Alexander R Pruss said...

Check if the file

But I think the problem is that the mod is for 0.4.13.

Shyam said...

Thanks a lot. I installed 0.4.13 and the issue is now solved. However, I still haven't understood the concept of using a turtle to draw stuffs in Minecraft. Also, can we modify the code to extend the features? Is the code in Python?


Alexander R Pruss said...

Have a look at my instructions for Minecraft: you can do basically the same things with Minetest.

Shyam said...

Thank you so much :) I will let you know if sth comes up.