miner icon indicating copy to clipboard operation
miner copied to clipboard

Adding Newer RaspberryJuice functionality

Open AugustT opened this issue 5 years ago • 8 comments

Hi Folks,

I've been using this a lot recently. For my needs it was constraining that I could not spawn entities. This is supported in the newer versions of raspberryjuice https://dev.bukkit.org/projects/raspberryjuice/files/2496319

I have successfully added a function to add entities, wrapping your internal functions. I'd be happy to help you add this if you decided you were happy to shift to the newer version of RaspberryJuice.

Tom

AugustT avatar Feb 11 '19 10:02 AugustT

Cool! It looks like there’s lots of new stuff: https://github.com/zhuowei/RaspberryJuice

kbroman avatar Feb 11 '19 12:02 kbroman

Did someone say individual based model represented in Minecraft?! Yes please!

AugustT avatar Feb 11 '19 13:02 AugustT

Looks like we have

  • world.getPlayerId( player_name)
  • world.getPlayerName( player_id)
  • world.getEntityTypes()
  • world.spawnEntity(x,y,z,type)
  • setDirection, setRotation, setPitch
  • setSign(x,y,z,block type id,data,line1,line2,line3,line4)

kbroman avatar Feb 11 '19 19:02 kbroman

I’ve got all of this working except setSign.

kbroman avatar Feb 11 '19 23:02 kbroman

For setSign(), we can create a standing sign with:

mc_send(merge_data("world.setSign", 117, 3, 85, 63, 4, "Hello"))

It should be that you can create a "wall" sign with the following, but I can't figure out how to get it to work.

mc_send(merge_data("world.setSign", 117, 3, 85, 68, 4, "Hello"))

kbroman avatar Feb 12 '19 03:02 kbroman

Great stuff.

Are you able to set multiple lines of text to the sign? ie

mc_send(merge_data("world.setSign", 117, 3, 85, 63, 4, "line1", "line2", "line3", "line4"))

Perhaps the wall sign can only spawn on a wall, and only when the orientation of the sign you are placing matches the orientation of the wall

AugustT avatar Feb 12 '19 09:02 AugustT

Yes, I could send multiple lines. the setSign() function I added takes a text argument that is a vector of character strings, one per line. One complication is I can't see how to have commas in the text, because the API uses commas as separators between arguments, so they end up breaking up the text into separate lines.

kbroman avatar Feb 12 '19 13:02 kbroman

Regarding the wall sign, I agree that it seems like you need a wall to place the sign onto, and that you need to get the orientation right. But I spent a bunch of time experimenting with it and couldn't successfully place a wall sign.

kbroman avatar Feb 12 '19 13:02 kbroman