- New command: /nightvision toggles night vision
- Unofficial and unsupported API to set block light level: block.setLightLevel(blockId, level) (level is a float between 0 and 1); unsupported APIs may be removed and their functionality may leave something to be desired
- text.py module for drawing large text banners
- various optimizations and bug fixes
- improved pypy support in script and mod (set python interpreter in mod config)
- new vehicle.py script: if you run it very near something that looks like a vehicle (or a house, or a statue), it will make that vehicle move along with you
I just released version 0.40 of Raspberry Jam Mod. For those who don't know, this is a mod for Minecraft 1.8 to support the Juice/Pi Python API on single-player Minecraft (also works with LAN sessions) without running a modded server.
In addition to general beta-quality code for the base Juice/Pi API, it includes experimental code (which may disappear if I am not happy with it) for three new major features:
1. Client-only "read-only" mode: use scripts on the client without the server supporting it
2. Multiple world support: use scripts in the Nether and the End
3. Server-side modding: use scripts server-side
These are all major features, but very technical. I will be happy to answer questions.
Detailed description:
1. Client-only "read-only" mode: What if you want to debug a script that generates some large structures but don't want to mess up the world you'd like to place the structures in while debugging? Or what if you want to run a python script while you're connected to a server not under your control?
So, I made a client-only read-only mode for Raspberry Jam Mod. From the Minecraft menu, if you choose "Mods", then "Raspberry Jam Mod", and then set Client-only read-only mode to "True".
If you use this mode, then any Python scripts you run will run on the client side and make no changes on the server side (except maybe to the player position). You can, however, call getBlock() and setBlock() to your heart's content. So you can create giant structures while in a world controlled by a server that you don't own. Because the structures are only on your client-side, other players won't see them, and they won't be saved. If you try to mine blocks from these structures, you will fail (and may end up mining the "real blocks" the server knows about).
There are two provisos. First, the usual /py command for running scripts doesn't work. You need /lpy. ("l" for "local") Second, scripts will be disconnected if you switch worlds.
The main thing I want to use this for is to have my kids run the scan.py script to capture buildings that they've built in a server we don't control, and then copy the buildings to a local world.
2. Multiple worlds: When I was teaching programming using Raspberry Jam Mod, it was unfortunate that python scripts didn't work in the Nether (they also don't work in the Nether using Juice) as occasionally students ended up there.
After thinking long and hard, I decided that the easiest way to make many (but not all) scripts work not just in the Overworld but in the Nether and The End is to extend the coordinate system to include the Nether and the End all within a single coordinate system, by imagining the worlds as stacked one over the other.
Specifically, the spawn position in the Overworld is at Python coordinates (0,0,0). The spawn position in the Nether is, however, at (0,-2000,0). The spawn position in The End is at (0,-4000,0). (This should extend if you're using a server with more worlds.) So if you're in the End and you call getPos(), you get a position with a y-coordinate somewhere around -4000. setBlock() works across all the worlds (though it may not work if the world hasn't been initialized yet). In theory, you should be able to take a magic bridge right through a portal from one world to another.
The major limitation is that getHeight() currently only works in the Overworld. But because Raspberry Jam Mod's getBlock() implementation is quite speedy, you can write your own getHeight() alternative to work in the other worlds. Another limitation is that setPos() won't move you across worlds.
If you don't like the solution, just don't use the large negative coordinates. It won't affect existing scripts.
3. Server-side modding: While Raspberry Jam Mod was designed to fill the niche of a mod for single-player Minecraft supporting the Python API, I can imagine wanting to run it in a server situation. To do that, you need to install Forge for 1.8 and the Mod both on the server and the client side. And everything should then just work, with scripts being run on the server side. This is basically how Juice works, except that you need Forge+RJM on the client side as well (due to Forge limitations) and you can use the standard Minecraft server instead of Bukkit, etc., though with Forge.
And I made an Instructable on how to use scripts with Raspberry Jam Mod to draw fractals!
I've just released 0.41. This includes a bug fix for the client-mode read-only option, as well as a heavily modified .obj mesh rendering script (based on Martin O'Hanlon's script).
Here's a fun thing to try:
/py render ds9
You should get the attached view of Star Trek's Deep Space 9 station (it'll take several minutes). You can also render the Enterprise with
/py render 1701d
The rendering is based on .txt files in the .minecraft\mcpipy\models directory. You can drop more .obj meshes there and create .txt control files for them.
You can also resize and rotate. For instance:
/py render 1701d 50 90 30 15
draws a tiny Enterprise (50 blocks), rotated by 90 degrees, with the nose pitched up 30 degrees, and rolled 15 degrees sideways.
I have uploaded a new Windows installer which includes a Python 3 interpreter. Everything included should now work with Python 3. And it now supports all Forge versions from 1.8 through 1.10.2.
Mod:
- changed passwords.dat filename to raspberryjammod_passwords.dat
- added raspberryjammod_permissions.dat control file to protect selected areas of the map [alpha quality; designed for servers]
- added options to disable in-wall and fall damage
Scripts:
- added a lot of block names to mcpi/block.py, supporting most blocks through Minecraft 1.10.2
- deprecated mc.py and mcturtle.py in favor of mine.py and mineturtle.py, which are the same as except blocks are referred to as block.BLOCKNAME instead of BLOCKNAME
- added RGBA and material data availability to Block structure; the RGB data is typically an average RGB value of a side-face; the alpha is mostly made up; the material data is made to support Visual Python
- added dithering and color rendering utilities; see earth.py and dither.py for examples on how to use; these are designed to use blocks from 1.10.2
- added support for running many scripts in Visual Python *without* Minecraft [alpha quality]; on Linux/OSX/Cygwin, after installing Visual Python, you can do:
MCPI_VPYTHON=1 python scriptname.py
On Windows, you can do:
set MCPI_VPYTHON=1
python scriptname.py
You can monitor placement events, yes. Have a look at symmetry.py, which is a script that helps you draw symmetric objects (for instance, "/py symmetry n" will help you draw an object north-sound reflection symmetric around the point where you are when you run the script--every block you place will draw another block in a flipped location).
I've uploaded 0.90 which fixes a bug with some recent Minecraft versions and updates a few scripts, like chess, and adds a pong game.
Is there any way that I could use this mod to run an interactive python interpreter in minecraft? If so, would I be able to use that to give input into one of the functions of one of my python scripts and receive output from that function in the minecraft chat?
I am just trying to jump on this minecraft wagon. My almost 9 year old daughter is very into it and just got her a gaming laptop :-) I teach programming but havent messed minecraft yet. Figure if I can get this working and show her a bit, she can teach her brother too. Anyway, I think I have it installed, but minecraft is not recognizing the /lpy command. Any guidance is appreciated!
Hi there. I believe if you're just running it locally on your own machine, you shouldn't need /lpy. If you're on a server with this mod installed, I believe that's the primary use case for /lpy. I hope your interest lead you to find a way to make it work, if /py isn't good for what you wanted to do. If you wanted to use /lpy for the non-destructive aspect, it may be worth starting a new world as a test environment, running your script there, then you can run it on your main world once you know what the script will do.
.
Version 0.28 released:
- New command: /nightvision toggles night vision
- Unofficial and unsupported API to set block light level: block.setLightLevel(blockId, level) (level is a float between 0 and 1); unsupported APIs may be removed and their functionality may leave something to be desired
- text.py module for drawing large text banners
- various optimizations and bug fixes
- improved pypy support in script and mod (set python interpreter in mod config)
Version 0.30 released:
- Minecraft.setBlockWithNBT, Minecraft.setBlocksWithNBT, Minecraft.getBlockWithNBT
- new vehicle.py script: if you run it very near something that looks like a vehicle (or a house, or a statue), it will make that vehicle move along with you
I just released version 0.40 of Raspberry Jam Mod. For those who don't know, this is a mod for Minecraft 1.8 to support the Juice/Pi Python API on single-player Minecraft (also works with LAN sessions) without running a modded server.
In addition to general beta-quality code for the base Juice/Pi API, it includes experimental code (which may disappear if I am not happy with it) for three new major features:
1. Client-only "read-only" mode: use scripts on the client without the server supporting it
2. Multiple world support: use scripts in the Nether and the End
3. Server-side modding: use scripts server-side
These are all major features, but very technical. I will be happy to answer questions.
Detailed description:
1. Client-only "read-only" mode: What if you want to debug a script that generates some large structures but don't want to mess up the world you'd like to place the structures in while debugging? Or what if you want to run a python script while you're connected to a server not under your control?
So, I made a client-only read-only mode for Raspberry Jam Mod. From the Minecraft menu, if you choose "Mods", then "Raspberry Jam Mod", and then set Client-only read-only mode to "True".
If you use this mode, then any Python scripts you run will run on the client side and make no changes on the server side (except maybe to the player position). You can, however, call getBlock() and setBlock() to your heart's content. So you can create giant structures while in a world controlled by a server that you don't own. Because the structures are only on your client-side, other players won't see them, and they won't be saved. If you try to mine blocks from these structures, you will fail (and may end up mining the "real blocks" the server knows about).
There are two provisos. First, the usual /py command for running scripts doesn't work. You need /lpy. ("l" for "local") Second, scripts will be disconnected if you switch worlds.
The main thing I want to use this for is to have my kids run the scan.py script to capture buildings that they've built in a server we don't control, and then copy the buildings to a local world.
2. Multiple worlds: When I was teaching programming using Raspberry Jam Mod, it was unfortunate that python scripts didn't work in the Nether (they also don't work in the Nether using Juice) as occasionally students ended up there.
After thinking long and hard, I decided that the easiest way to make many (but not all) scripts work not just in the Overworld but in the Nether and The End is to extend the coordinate system to include the Nether and the End all within a single coordinate system, by imagining the worlds as stacked one over the other.
Specifically, the spawn position in the Overworld is at Python coordinates (0,0,0). The spawn position in the Nether is, however, at (0,-2000,0). The spawn position in The End is at (0,-4000,0). (This should extend if you're using a server with more worlds.) So if you're in the End and you call getPos(), you get a position with a y-coordinate somewhere around -4000. setBlock() works across all the worlds (though it may not work if the world hasn't been initialized yet). In theory, you should be able to take a magic bridge right through a portal from one world to another.
The major limitation is that getHeight() currently only works in the Overworld. But because Raspberry Jam Mod's getBlock() implementation is quite speedy, you can write your own getHeight() alternative to work in the other worlds. Another limitation is that setPos() won't move you across worlds.
If you don't like the solution, just don't use the large negative coordinates. It won't affect existing scripts.
3. Server-side modding: While Raspberry Jam Mod was designed to fill the niche of a mod for single-player Minecraft supporting the Python API, I can imagine wanting to run it in a server situation. To do that, you need to install Forge for 1.8 and the Mod both on the server and the client side. And everything should then just work, with scripts being run on the server side. This is basically how Juice works, except that you need Forge+RJM on the client side as well (due to Forge limitations) and you can use the standard Minecraft server instead of Bukkit, etc., though with Forge.
And I made an Instructable on how to use scripts with Raspberry Jam Mod to draw fractals!
I've just released 0.41. This includes a bug fix for the client-mode read-only option, as well as a heavily modified .obj mesh rendering script (based on Martin O'Hanlon's script).
Here's a fun thing to try:
/py render ds9
You should get the attached view of Star Trek's Deep Space 9 station (it'll take several minutes). You can also render the Enterprise with
/py render 1701d
The rendering is based on .txt files in the .minecraft\mcpipy\models directory. You can drop more .obj meshes there and create .txt control files for them.
You can also resize and rotate. For instance:
/py render 1701d 50 90 30 15
draws a tiny Enterprise (50 blocks), rotated by 90 degrees, with the nose pitched up 30 degrees, and rolled 15 degrees sideways.
I posted a new version with better support for importing meshes. Here are instructions: http://www.instructables.com/id/Star-Wars-and-Star-Trek-in-Minecraft-with-Raspberr/
I ported RJMto Minecraft/Forge 1.9.
And for Easter, I made an Easter egg script. E.g.:
/py pysanka 100 pysanka2.jpg 2
(if the pysanka2.jpg image is in your scripts folder). Unfortunately, you need to install PIL for your python distribution.
I just uploaded a new version with preliminary (alpha-quality) support for Minecraft/Forge 1.10.
I added a falling block game. Requires Windows. Run with /py minetris. Video .
I have uploaded a new Windows installer which includes a Python 3 interpreter. Everything included should now work with Python 3. And it now supports all Forge versions from 1.8 through 1.10.2.
Lots of updates in 0.80.
Mod:
- changed passwords.dat filename to raspberryjammod_passwords.dat
- added raspberryjammod_permissions.dat control file to protect selected areas of the map [alpha quality; designed for servers]
- added options to disable in-wall and fall damage
Scripts:
- added a lot of block names to mcpi/block.py, supporting most blocks through Minecraft 1.10.2
- deprecated mc.py and mcturtle.py in favor of mine.py and mineturtle.py, which are the same as except blocks are referred to as block.BLOCKNAME instead of BLOCKNAME
- added RGBA and material data availability to Block structure; the RGB data is typically an average RGB value of a side-face; the alpha is mostly made up; the material data is made to support Visual Python
- added dithering and color rendering utilities; see earth.py and dither.py for examples on how to use; these are designed to use blocks from 1.10.2
- added support for running many scripts in Visual Python *without* Minecraft [alpha quality]; on Linux/OSX/Cygwin, after installing Visual Python, you can do:
MCPI_VPYTHON=1 python scriptname.py
On Windows, you can do:
set MCPI_VPYTHON=1
python scriptname.py
Is there any chance that you might port this to Spigot or spongevanilla? That would be awesome!
Release 0.85 supports Minecraft 1.11.
You can monitor placement events, yes. Have a look at symmetry.py, which is a script that helps you draw symmetric objects (for instance, "/py symmetry n" will help you draw an object north-sound reflection symmetric around the point where you are when you run the script--every block you place will draw another block in a flipped location).
I've uploaded 0.90 which fixes a bug with some recent Minecraft versions and updates a few scripts, like chess, and adds a pong game.
I posted 0.92, which supports Minecraft 1.12.
I've installed the mod and having a problem with the coordinates.
Pulled this from the mdmod.info from the RaspberryJamMod.jar file.
"version": "0.92",
"mcversion": "1.10.2"
Details can be seen in this screenshot.
http://imgur.com/a/aYJAa
My code is as follows.
Is there any way that I could use this mod to run an interactive python interpreter in minecraft? If so, would I be able to use that to give input into one of the functions of one of my python scripts and receive output from that function in the minecraft chat?
Hello!!
I am just trying to jump on this minecraft wagon. My almost 9 year old daughter is very into it and just got her a gaming laptop :-) I teach programming but havent messed minecraft yet. Figure if I can get this working and show her a bit, she can teach her brother too. Anyway, I think I have it installed, but minecraft is not recognizing the /lpy command. Any guidance is appreciated!
Hi there. I believe if you're just running it locally on your own machine, you shouldn't need /lpy. If you're on a server with this mod installed, I believe that's the primary use case for /lpy. I hope your interest lead you to find a way to make it work, if /py isn't good for what you wanted to do. If you wanted to use /lpy for the non-destructive aspect, it may be worth starting a new world as a test environment, running your script there, then you can run it on your main world once you know what the script will do.
Python in minecraft, amazing!
One can now use the mod with Scratch: https://www.instructables.com/Coding-in-Minecraft-With-Scratch/
Sadly, it still only works up to 1.12.2.