My son wants to make a game in Python that is materialized in Minecraft. If he does that using the RasPi Edition, can that same Python code control the normal Minecraft on a PC? My guess is that Python sends commands to Minecraft rather than running in the same VM, so it should work for both.
Check out my blog post Drawing Sierpinski's Triangle in Minecraft Using Python. I was able to write Python code that plugs into the open source Minecraft server called Bukkit. You can use a normal Minecraft client on OS X to connect to the Bukkit server.
It's not as easy to setup as it is on Raspberry Pi, but it does work.
I wrote a Forge mod (Raspberry Jam Mod) for desktop Minecraft that implements most of the Pi version's protocol, and works with the scripts I've tested. Event handling is the major omission.
Source code and binaries are here.
- Install Forge for 1.8.
- Create a Minecraft profile that uses it.
- Create a mods subdirectory to your Minecraft directory (%appdata%.minecraft on Windows).
- Put my mod in the mods directory.
- Create an mcpipy subdirectory to your Minecraft directory.
- Put the contents of the Minecraft PI Python package into the mcpipy directory.
- Create a Minecraft profile that uses the 1.8 Forge.
- Run Minecraft and create a world.
- Run python scripts via commandline or straight in Minecraft via /py scriptname. E.g., /py nt7s_sphere will draw a sphere.
If you want even more detail, I wrote an Instructable.
I found this working for me with Minecraft 1.7.10 (as user875707's answer solution is meant to be used with Minecraft 1.8).
All the instructions are in the link above but basically, you just need to download the
.jar they offer you and drop it into your
You will both need Forge installed and Python (2 or 3 even though the sample scripts are designed for Py2).
Also makes sure that Python is in your
PATH (aka you can just type
python in your terminal - use this if it isn't).
That's about that simple for setup.
Place your scripts in
your_minecraft_folder/mcpimods/python/ and launch from ingame by typping
/python yourscriptname (or just
/py yourscriptname), do not include the
.py at the end of
yourscriptname. If anything went wrong, check your console to see the error.
EDIT: Very powerful tool, BE CAREFUL, I did manage to corrupt my world. Hopefully I had AromaBackup installed which does automatic backup every so often (30 minutes for me).
EDIT 2: I found out you can also you the mod CustomNPC which allows you to use about whichever languages you want to run the NPCs (themselves can do a lot of things, including running commands, etc).
No not really. At this point the three versions (pc, xbox and minecraft) are all entirely different branches. A mod will often not work on a pc from version 1.x to version 1.x+1 so you're really not going to see any kind of cross compatibility.