
Programming Minecraft on the Raspberry Pi - foxwoods
http://blog.wolfram.com/2018/07/05/programming-minecraft-on-the-raspberry-pi/
======
gavanwoolery
I used to joke that Voxel Quest was just a fancy 3d graphing calculator. I
think the entryway for a lot of students to become interested in math is to
make rendering more accessible. Shadertoy is one step towards this, but SDF
equations are much more difficult to grok than binary on/off voxel plotting,
and they have to be mathematically sound or you get buggy looking results.

~~~
TeMPOraL
During my university times, I often used EvalDraw as quick 2D/3D graphing
calculator:

[http://advsys.net/ken/download.htm](http://advsys.net/ken/download.htm)

You type in some C-ish code, it gets immediately executed and drawn. Instant
feedback was a winner feature here. Graphing y=f(x) was AFAIR as simple as
typing "(x)" in the first line and writing an expression in the next. "(x,t)"
for time-varying singals, "(x,y)" for 2-d functions with values viewed as
colors, "(x,y,z,&r,&g,&b)" for full-voxels, etc.

I don't even remember how this little program found its way to my hard drive,
but I had a lot of good times with it.

~~~
Darkskynet
Thanks so much for sharing this! This is awesome :D

Me and my boyfriend are both math nerds and will both love this :)

------
Confiks
Another interesting environment to explore related to Minecraft is an open-
source clone of that game: Minetest [1].

It allows extensions in the form of Lua scripts. There is an extension [2]
that opens up a TCP socket which can be used to modify the environment in any
language across the network. There is an accompanying Python library [3] that
is quite accessible (I had to use the 2to3 tool to seamlessly convert it to
Python 3 because of some dependency problem).

I've been trying to get it to work in WebAssembly (some notes here [4]) and
maybe connect Blockly / Scratch to it, but unfortunately the WebAssembly
shared memory model is postponed due to the Spectre and Meltdown debacle [5].

[1] [https://www.minetest.net/](https://www.minetest.net/)

[2]
[https://github.com/sprintingkiwi/pycraft_mod](https://github.com/sprintingkiwi/pycraft_mod)

[3]
[https://github.com/sprintingkiwi/pycraft_lib](https://github.com/sprintingkiwi/pycraft_lib)

[4]
[https://news.ycombinator.com/item?id=14855176](https://news.ycombinator.com/item?id=14855176)

[5]
[https://github.com/WebAssembly/meetings/blob/master/2018/CG-...](https://github.com/WebAssembly/meetings/blob/master/2018/CG-01-09.md#update-
on-webassembly-atomics)

------
kbouck
Lots of fun stuff you can program in Minecraft Pi Edition.

My son and I made a minecraft version of snake/tron where each player would
leave behind a trail of TNT blocks as they ran around a closed arena. Hitting
a TNT would set off such huge chain reaction of explosions that the raspberry
pi couldn't handle it. After a few rounds of these explosions the minecraft
world looks like a total wasteland.

~~~
giancarlostoro
I honestly wish they had some of that level of scripting for the desktop
version too, I love the idea of doing Python with Minecraft. Plus fun ideas
like that could scale a little better on a much more powered system.

~~~
dagw
have you seen Microsoft MakeCode? [https://www.microsoft.com/en-
us/research/blog/code-minecraft...](https://www.microsoft.com/en-
us/research/blog/code-minecraft/)

[https://minecraft.makecode.com/](https://minecraft.makecode.com/)

It's a scratch like programming environment that lets you do all kinds of cool
things in Minecraft.

------
klinskyc
This is fantastic. Minecraft is one of the big factors that made me want to
learn Java (back when the game first came out), and indirectly spurred a lot
of my own personal development. The easier they can make it, the better.

~~~
rococode
Minecraft, and in particular Bukkit (API for coding server plugins), is by far
the single biggest factor in my own development as a programmer. Literally
hundreds of hours spent coding plugins for my server, starting from copy-
pasting tutorials in the early days and eventually being able to build fairly
complex projects on my own. It's formed my personal belief that being able to
visually see the effects of code and being able to write code that augments
things that are already interesting are great ways to encourage young kids and
teens to code.

------
DonHopkins
Snap! is an awesome scheme-like visual programming language that runs in the
browser, which is a lot like Scratch (visual Logo), but like Scheme in that
everything is first class, including functions, lexical closures,
continuations, macros, special forms, user defined functions, control
structures, etc.

[https://snap.berkeley.edu](https://snap.berkeley.edu)

ProgKids is a Russian site that integrates Snap! (and Python) with Minecraft,
so kids can visually program 3d turtles that move around in the world and
build things!

[https://progkids.ru](https://progkids.ru)

ProgKids. Строим дом, а потом ещё пару (Building a house, then another couple)

[https://www.youtube.com/watch?v=muNpsk4UH7c](https://www.youtube.com/watch?v=muNpsk4UH7c)

ProgKids. Куда же без зверей? (Why do you not have animals?)

[https://www.youtube.com/watch?v=1iBFwaUSDYI](https://www.youtube.com/watch?v=1iBFwaUSDYI)

ProgKids. Как работает Snap? (How does Snap work?)

[https://www.youtube.com/watch?v=lh0mrqxFImQ](https://www.youtube.com/watch?v=lh0mrqxFImQ)

------
itronitron
Minecraft added a full set of command blocks (impulse, repeat, and chain) back
in version 1.9 which allow players to make similar modifications to worlds, as
well as create and equip entities with various items and behaviors. Basically
you add a command to a command block in game, and then it executes when the
command is activated. I think command blocks are an easier foray into coding
in Minecraft although it would be nice to see more capabilities added in the
future.

------
snek
anyone know what API wolfram is using here to communicate with the minecraft
client?

~~~
rocky1138
Minecraft Pi has a built-in connection with IDLE. Take a look:
[https://projects.raspberrypi.org/en/projects/getting-
started...](https://projects.raspberrypi.org/en/projects/getting-started-with-
minecraft-pi)

------
pcunite
If you own the Minecraft Windows 10 Edition, you can download their "Code
Connection" server and start coding right away in JavaScript.

Links:

[https://minecraft.makecode.com/setup](https://minecraft.makecode.com/setup)

[https://aka.ms/meeccwin10](https://aka.ms/meeccwin10)

------
JustSomeNobody
Off topic:

What are some decent general tutorials for programming voxel games?

------
emeth
A related project, not limited to the Raspberry Pi:
[https://teachcraft.net/](https://teachcraft.net/)

------
sdan
Imagine running the winning MARLÖ model on this. That's going to turn a lot of
heads (most likely going to attract attention from kids as well).

