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)
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])
mcpi package to Processing/Java could be a good starting point for something that works cross-platform.