So, I am having a problem with a nested command, I made a "one command" creator a while ago and I am trying to make it work again, so what it does is: spawn a lot of minecart command blocks on an activator rail and this executes them, then I want the command block minecarts to execute the commands that set block the real working command blocks because there are no repeating command block minecarts. But the problem that I am having is that the command in the minecarts needs to have a nested command in it for the command block that it set blocks, which looks like this:

Passengers:[{id:command_block_minecart,Motion:[0.0,.8,0.0],Command:"/setblock ~ ~ ~ minecraft:repeating_command_block{Command: ["execute as @e[tag=s] at @s run summon tnt ~ ~ ~"]}"

But this approach puts two ""strings into each other so like this: command: "command:""" and this doesn't work. Does someone know how I can use this character: " in a string in Minecraft?

  • 1
    Have you tried escaping the inner " with \ ?
    – dly
    Commented Feb 25, 2022 at 15:21
  • Thanks, this worked! (I feel very dumb) Commented Feb 25, 2022 at 15:28
  • 3
    Possible duplicate of Why am I getting an 'unexpected token' error with this Minecraft /give command?
    – pppery
    Commented Feb 25, 2022 at 15:39
  • I think this should be opened for review because it is a different more specific question than the reason for closing.
    – Blue Robin
    Commented Feb 28, 2022 at 1:37
  • @BlueRobin Unfortunately this is still a duplicate, if not of the current duplicate link, then of this one which covers the first level of escaping. Make sure you have searched thoroughly for other potential duplicates before submitting for review.
    – One 2 Many
    Commented Mar 3, 2022 at 5:15


Browse other questions tagged .