Can you use json codes on signs in Minecraft?

Can I use a json code on signs? I tried /tellraw @p {text"hi",color:blue} and it worked as expected, but can you use them for signs?


Solution 1:

When you're making signs with colored text, you have can only do it with the /setblock command. Also, remember that you cannot use the Selection Symbol (§) in chat. So, this is how you create a sign with color.

(Or you can look up the wiki)


Place a command block ABOVE where you want your sign to go.

Use /setblock ~ ~-1 ~ standing_sign [Rotation] replace {Text1:"{Text:"[Text String]",color:[Color]}",Text2:"{Text:"[Text String]",color:[Color]}",Text3:"{Text:"[Text String]",color:[Color]}",Text4:"{Text:"[Text String]",color:[Color]}"}
Of course, it won't fit in your hotbar. So, put it on a command block directly above where you would like to place the block and then activate it.

Replace [Rotation] with a number between 0 and 15. 0 faces South, 4 faces West, 8 faces North and 12 faces East. 16 (the same as 0) will face South.
Replace [Text String] with the json string that you want the sign to contain... Or plain text. As long as everything fits on the sign, it will not be chopped off.
Replace [Color] with a color; "Red", "Blue", "Yellow", "Green", "Gold", "Gray" are some examples. (As long as it's a color that Minecraft chat supports).