I am trying to make a 1 command generator that allows creation of signs at the front. Unfortunately, when I summon the command block with the setblock in, the json has the \removed and so the command does not work.
Note, it says unknown macro in this website for some reason and so I placed it in pastebin:
http://pastebin.com/QntgSjfy
Original Command:
/summon FallingSand ~ ~1 ~ {Tile:command_block,Block:command_block,TileEntityData:{Command:"execute @p ~ ~ ~ setblock ~-2 ~-1 ~ minecraft:wall_sign 4 replace {Text1:\"{text:\"Hello\",color:gold}\"}"},Time:1}
Summoned Command:
execute @p ~ ~ ~ setblock ~-2 ~-1 ~ minecraft:wall_sign 4 replace {Text1:"{text:"Hello",color:gold}"}
Attachments
Comments 4
Hey, I tried to add the bold part to it, and it doesn't seem to work, it just shows the whole of the text:'hello',bold: on the sign.
/summon FallingSand ~ ~1 ~ {Tile:command_block,Block:command_block,TileEntityData:{Command:"execute @p ~ ~ ~ setblock ~-2 ~-1 ~ minecraft:wall_sign 4 replace {Text1:\"{text:'Hello',bold:'true',color:gold}\"}"},Time:1}
I don't know what you're doing, but if I add bold:true
, it's working as expected:
/summon FallingSand ~ ~1 ~ {Tile:command_block,Block:command_block,TileEntityData:{Command:"execute @p ~ ~ ~ setblock ~-2 ~-1 ~ minecraft:wall_sign 4 replace {Text1:\"{text:'Hello',bold:true,color:gold}\"}"},Time:1}
That is how escaping works:
Get the outer text and replace every two backslashes with one
1. /summon FallingSand ~ ~1 ~ {Tile:command_block,Block:command_block,TileEntityData:{Command:"execute @p ~ ~ ~ setblock ~-2 ~-1 ~ minecraft:wall_sign 4 replace {Text1:\"{text:\"Hello\",color:gold}\"}"},Time:1}
2. execute @p ~ ~ ~ setblock ~-2 ~-1 ~ minecraft:wall_sign 4 replace {Text1:"{text:"Hello",color:gold}"}
To escape text properly you need to replace
1. \ with \\
2. " with \" (or ' with \' depending on what kind of quotation marks you used for the "layer above")
So your command should look like this:
/summon FallingSand ~ ~1 ~ {Tile:command_block,Block:command_block,TileEntityData:{Command:"execute @p ~ ~ ~ setblock ~-2 ~-1 ~ minecraft:wall_sign 4 replace {Text1:\"{text:\\\"Hello\\\",color:gold}\"}"},Time:1}
You cannot nest more than one kind of quotes.
Use