RaspberryJuice
Want to try to program with the Minecraft Pi API but with the full version of Minecraft? RaspberryJuice implements the Minecraft Pi modding API for Bukkit servers.
The plugin listens on port 4711, and accept most of the Minecraft Pi commands, which are documented at http://wiki.vg/Minecraft_Pi_Protocol .
The plugin supports the majority of the api's supplied with the Pi edition and most examples will work.
Currently implemented commands:
world.getBlock
world.getBlockWithData
world.setBlock
world.setBlocks
world.getPlayerIds
chat.post
events.clear
events.block.hits
player.getTile
player.setTile
player.getPos
player.setPos
world.getHeight
entity.getTile
entity.setTile
entity.getPos
entity.setPos
Extra features(^):
getBlocks(x1,y1,z1,x2,y2,z2) has been implemented
getDirection, getRotation, getPitch functions - get the 'direction' players and entities are facing
getPlayerId(playerName) - get the entity of a player by name
pollChatPosts() - get events back for posts to the chat
Config (in config.yml):
- port: 4711 - the default tcp port can be changed in config.yml
- location: RELATIVE - determine whether locations are RELATIVE to the spawn point (default like pi) or ABSOLUTE
- hitclick: RIGHT - determine whether hit events are triggered by LEFT clicks, RIGHT clicks or BOTH
^ to use the extra features an modded version of the java and python libraries that were originally supplied by Mojang with the Pi is required, https:github.com/zhuowei/RaspberryJuice/tree/master/src/main/resources/mcpi. You only need the modded libraries to use the extra features, the original libraries still work, you just wont be able to use the extra features
Example:
This Python script builds a rainbow near the spawn. Place this example in the api/python directory of the Minecraft Pi prerelease, start the server on the same computer, and run python name.py to run, replacing name.py with the actual name of the script.
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() height = 60 mc.setBlocks(-64,0,0,64,height + len(colors),0,0) for x in range(0, 128): for colourindex in range(0, len(colors)): y = sin((x / 128.0) * pi) * height + colourindex mc.setBlock(x - 64, y, 0, block.WOOL.id, colors[len(colors) - 1 - colourindex])
Result:
Further examples can be found at http:www.stuffaboutcode.com/p/minecraft.html
Great plugin, thank you!! I've created a step-by-step guide to getting started with the plugin here... https://gist.github.com/noahcoad/fc9d3984a5d4d61648269c0a9477c622
Can you make custom commands? (/tp, /help, etc)
Hi,
Why on Windows 10 64 Bits can't work?
Can you make Commands with this Plugin? Like /spawn or /home.
Hello. Been dreaming about this for years. Does it support if-else-break operators? Do I have to install actual Python?
In reply to crystallize1:
@Chardinok
Hi, do you have any more information? What do you mean doesnt work? Do you get errors when launching bukkit?
Or do you mean you cant download Bukkit? - because that is a different problem and nothing to do with RaspberryJuice.
If you have more information, can you raise an issue on github? https://github.com/zhuowei/RaspberryJuice
@Chardinok
Use a later version like 1.8
This does not work! i am using 1.6.4 and i tried to download it still nothing! HELP!
In reply to Chardinok:
Just got this working with Python 3.7, Minecraft 1.13.2 Java Edition, spigot mc server on windows 10.
@DavePottsUK
Many thanks Dave, much appreciated, will give that a whirl.
Avon
@AvonVII
You are right that it doesn't necessarily match. Raspberry Juice takes (0,0,0) to be the world spawn point. If you want the coordinates to match up then go over to the CraftBukkit server console and type
Perhaps I'm missing something obvious, but if I use player.getTilePos() the values returned don't match the Minecraft X,Y,Z coordinates like the do on the Pi.
For example, Minecraft reports x:866,y:67,z:608, but mc.player.getTilePos() returns 18,2,-2
I've got some code that scans an area and writes out a CSV of the blocks, on the Pi it's fine, but with the running it using the Raspberry juice plugin it is scanning the wrong place. :-(
Thanks,
Avon
Hey! Awesome work! I owe you guys a beer!
I am working with some friends for Kids Hack Day and one of our programs is to teach kids how to program with Minecraft. We are using right now Raspberry Pi but it's quite frustrating for them to go home and not being able to practice what they learned.
We will run a Game Development program inside Minecraft from middle of October to December and definitely we'll user your plugin to enable the littles to keep programming after the classes.
One thing we are working right now is an abstraction (almost a game engine) to build mini-games inside Minecraft. Hide and seek, capture the flag, sokoban, treasure hunt and many other examples are on our scope.
I noticed that you only exposed one type of events, even Bukkit expose more than that, are you guys planning to expose them entirely? Would be possible to us to contribute on your roadmap by developing or suggesting features?
Since now, thank you very much for your work, it's really inspirational!
@XMrPotatoX
Fixed the issue with getentities in v1.4
1.4 has been released...
Its mainly bug fixes but it does include the ability to change the TCP port by modding the config.yml.
@XMrPotatoX
I have raised an issue in the github repository for the getting player ids:
https://github.com/zhuowei/RaspberryJuice/issues/13
If you have any more info about the issues you having could you add them to the issue?
What commands did you want to add? It would need a change to the plugin, but if you have any ideas it would good to hear them.
So I've just now discovered this and it is awesome. I'm using it on 1.7.10 and it works fine. I seem to be having issues getting player IDs but thats fine. I was just wondering if there's any way to add my own commands? I'm sure that its possible, I'm just too new at this to figure it out...
@TechnicolorDalek
Yes it does. Tested extensively with 1.6.4, but there is no reason why it shouldn't work with 1.7.x
Does this work with any version past 1.4.7? And if not, any chance of updating it? I love using the Pi version of MC and'd love to have this on my server.