Is there a way to set the text of a sign block?

67 views
Skip to first unread message

Jeremy Chen

unread,
May 16, 2015, 9:23:32 AM5/16/15
to adventures-in-...@googlegroups.com
Hi,

I am trying to use Minecraft to teach Chinese. I can place a sign block successfully thanks to the Starter Kit and the book.

I use the id of the sign block, 63, and its subtype.

I wonder if there is a way to set the text as well. Since Minecraft doesn't support Chinese input, it will be very useful if this can work.
ps: "postToChat" works with Chinese.

============================
import mcpi.minecraft as minecraft
import mcpi.block as block

mc = minecraft.Minecraft.create()

mc.postToChat('中文')
pos = mc.player.getTilePos()
mc.setBlock(pos.x+3, pos.y, pos.z, 63, 1)

Alexander Pruss

unread,
Jun 19, 2015, 9:37:06 AM6/19/15
to adventures-in-...@googlegroups.com
The main API (PI/Juice) does not allow that. The mcpipapi mod has world.setTileEntityHex() command. I don't know how to turn the nbt for a sign label into hex, but this might be  a start: http://wiki.vg/NBT

I may eventually add nbt support to Raspberry Jam Mod, and if I do that, it will be text-based.

Another option for you is to put text in large bitmaps, as in my text module (which doesn't currently support non-Western text, but could be pretty easily extended).

Alexander Pruss

unread,
Jun 19, 2015, 10:05:21 PM6/19/15
to adventures-in-...@googlegroups.com
Also, version 0.29 of my Raspberry Jam Mod supports NBT.

Since minecraft.py doesn't support this (and may not, as this is experimental, and doesn't work in Juice or the PI or mcpiapi), you need to send the command directly via Minecraft.conn. For instance:
 mc = Minecraft.create()
 mc.conn.send("world.setBlock",0,0,0,63,1,"{id:\"Sign\",Text1:\"Line1\",Text2:\"Line2\",Text3:\"Line3\",Text4:\"Line4\"}")

Reply all
Reply to author
Forward
0 new messages