0

How do I /setblock a sign with text?

I've tried

/setblock ~ ~1 ~ minecraft:wall_sign 5 {id:"Sign",Text1:"hi;,Text2:""}

2 Answers 2

4

In commands, the order of arguments is important. This is the syntax of /setblock:

/setblock <x> <y> <z> <TileName> [dataValue] [oldBlockHandling] [dataTag]

You have given /setblock a [dataTag] argument where [oldBlockHandling] should be, so it doesn't do anything with it.

You will need to give an old block handling mode, such as replace before you give the data tag.

Although likely a typo, it is also important to have correct a JSON format. You have put a ; where a " is needed.

The corrected command should be:

/setblock ~ ~1 ~ wall_sign 5 replace {Text1:"hi",Text2:""}
1
  • Does this still work? The wiki says you also need Text3 and Text4, otherwise the text will not appear. Commented Nov 27, 2017 at 10:14
-1

Try this: /setblock ~ ~1 ~ wall_sign 5 [replace|destroy|(none)] {Text1:"{\"text\":\"Your Text Here\"}"} << never forget to use backslashes before an opening or closing quotation.

If you want it to have colors: /setblock ~ ~1 ~ wall_sign 5 {Text1:"{\"text\":\"Your Text Here\",\"color\":\"your_color\"}"} << on using colors, for spacing (such as red or dark red), use an underscore to indicate it as space ; see colors here: http://minecraft.tools/en/color-code.php , use the color names; never forget to use backslashes before an opening or closing quotations, right :) .

For text styles: /setblock ~ ~1 ~ wall_sign 5 {Text1:"{\"text\":\"Your Text Here\",\"color\":\"your_color\",\"bold\":\"true\"}"} << existing style tags: bold, italic, underline, obfuscated (or randomizing text) only use boolean responses on these tags (like true or false. 0 or 1 is not accepted.);

To put text on appropriate text line: For 1st line: Text1 tag; For 2nd line: Text2 tag; For 3rd line: Text3 tag; For 4th line: Text4 tag; (take note that these Text~ tags have same tags inside, like the colors and style tags); (also take note that signs only have 4 lines :) .)

Want all lines to be put? Use them altogether.

5
  • You don't need it to be so complicated. The text in Text1 can just be a regular string instead of JSON, if you just want to display a normal text. In general you wrote a lot of things that were not asked. Maybe search for a question that actually requires JSON and answer there, if noone did yet. Commented Nov 27, 2017 at 10:16
  • 1
    Well, he may take use of it some other time.
    – amegyoushi
    Commented Nov 27, 2017 at 10:20
  • No, because he wasn't even notified. He deleted his account. Commented Nov 27, 2017 at 10:29
  • So I just replied to no one? :P
    – amegyoushi
    Commented Nov 27, 2017 at 10:31
  • 1
    You relied to all the future readers of this question. If you look at the top right of the page, you can see that 10127 people visited this question already. And the protected state indicates that apparently there were many "I have this problem, too" comments. So you can expect many people in the future to read this answer. Commented Nov 27, 2017 at 10:42