Hi,
I’m teaching my students basic programming and would like to know if there’s any way to join processing language with minecraft through any mod or something else.
I would like to interact with the world, bot programming, etc…
It would be an awesome way to get them focused hehe.
As minecraft is also java based, it should not be very complicated I think.
Cool!! I had a Raspberry Pi sitting around and got the basic connection working with Minecraft Pi. The process may be similar on Windows/macOS but I don’t have a license (yet).
First, create a new sketch and add a code folder within the sketch’s folder. Next, copy the McPi.jar file from /opt/minecraft-pi/api/java/lib/ to the sketch’s code folder. With a game open, run the following sketch.
At least in the Windows version (but it should work for all OS versions AFAIK), dragging and releasing a “.jar” file on the PDE automatically creates the subfolder “code/” and copy the “.jar” file into it.
Made a little progress on macOS this afternoon–might suggest a general solution.
I installed version 1.12.2 of Minecraft, Forge, and the Raspberry Jam Mod, which implements nearly the same API as Minecraft Pi.
I created a world and tried running the rainbow example with Jython from the terminal and it worked! Next, I modified the rainbow example a bit in Python Mode, saved the sketch, then copied the mcpi package to the sketch’s folder. I created another new world, ran the sketch, and clicked on the window that popped up.
import mcpi.minecraft as minecraft
import mcpi.block as block
from math import *
colors = [14, 1, 4, 5, 3, 11, 10]
mc = minecraft.Minecraft.create()
rainbow_height = 60
mc.setBlocks(-64, 0, 0, 64, rainbow_height + len(colors), 0, 0)
def draw():
if mousePressed:
for x in range(0, 128):
for colourindex in range(0, len(colors)):
y = sin((x / 128.0) * pi) * rainbow_height + colourindex
mc.setBlock(x - 64, y, 0, block.WOOL.id, colors[len(colors) - 1 - colourindex])
GUI interface to run a command-line tool
I used some JAVA directly for this in the Processing applications.
It was to control my LCD screen colors; I created an interface to a free command-line tool that did this.
What form of Minecraft are you running – what version, on what hardware / platform, with what operating system? Did you try the version and example described above?
The version I have is 1.14 on PC x64 bits. Finally, what I want is to send data such as position, life, hunger, strength, that kind of variables towards arduino led matrix. But I have no idea how to read data from minecraft. I will try your example for var if it works on PC.