15

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.

12

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.

  • Note: Code written for the Raspberry Pi should be almost exactly the same as code written for the RaspberryJuice plugin (The plugin used in the above link). However, it is not quite complete, so you may have to tweak your code slightly in some circumstances. – daviewales Dec 19 '13 at 4:12
8

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.

To install, you'll need python, Minecraft 1.8, Minecraft Forge, my Raspberry Jam Mod and the Minecraft PI Python package. Then:

  1. Install Forge for 1.8.
  2. Create a Minecraft profile that uses it.
  3. Create a mods subdirectory to your Minecraft directory (%appdata%.minecraft on Windows).
  4. Put my mod in the mods directory.
  5. Create an mcpipy subdirectory to your Minecraft directory.
  6. Put the contents of the Minecraft PI Python package into the mcpipy directory.
  7. Create a Minecraft profile that uses the 1.8 Forge.
  8. Run Minecraft and create a world.
  9. 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.

3

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).

https://github.com/kbsriram/mcpiapi

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 your_minecraft_folder/mods/.

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).

  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Steve Robillard Mar 26 '15 at 20:28
  • @SteveRobillard Whilst I agree with your statement, I'm not sure how to improve it in this particular case. – JeromeJ Mar 27 '15 at 7:20
  • @SteveRobillard Made an, hopefully successful, attempt to improve my answer's quality. – JeromeJ Mar 27 '15 at 7:32
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.