When using one command block to place another command block with a command such as
/setblock ~1 ~ ~ minecraft:command_block 0 replace {Command:"{text:\"/say Test\"}"}
I expect the created command block to have the command
/say Test
but instead the JSON is not interpreted, leaving the command
{text:"/say Test"}
Linked issues
Attachments
Comments 4
The /say Test example is itself workaround-able by using a plain string. The true application I needed JSON for includes a command closer to
/setblock ~1 ~ ~ minecraft:command_block 0 replace {Command:"{text:\"tp @p[score_ID=\"}, extra:[ {score:{name:\"x\",\"var\"}}, {text:\"] ~ ~ ~\"} ]"}
Which relies on JSON for the score component.
The
Command
argument of a command block must be plain text - also there is no need to put it in JSON.If you need to put a
tellraw
command in the setblock'ed command block, then the argument oftellraw
can be in JSON, e.g.