Problem with multiple commands in one Command Block

I followed the guide here to run multiple commands in one command block. Here is my command:
/summon falling_block ~ ~1 ~ {Block:command_block,Time:1,TileEntityData:{Command:\”/give @s minecraft:bow 1\”},Passengers [{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:\\”/give @s minecraft:arrow 64\\”},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:\\\”/tp @s 384.700 7 400.700\\\”},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:\\\\”/fill ~ ~-5 ~-1 ~~50 ~-1 redstone_block\\\\”},Passengers:[{id:falling_block,Block:redstone_block,Time:1}]}]}]}]}
The command should give the executing player one bow, then 64 arrows, then tp the player to the given coordinates. This is executed through the filled redstone blocks that trigger the multiple falling command blocks created as per the guide.
However, I'm getting the following error message upon triggering the initial command block:
[21:14:41] Data tag parsing failed: Expected value at: ...ock,Time:1,TileEntityData:{Command:<--[HERE]
I realise that this may be tricky to troubleshoot, but any help would be appreciated :)
Best Answer
My first recommendation would be to use a different method of running three commands. Two other possibilities you could use are chained command blocks or a function. If you absolutely need it in one command block then use a function, otherwise, use a chain of command blocks as it is simpler. To do the latter, place three command blocks next to each other so that they point into each other. Then when putting commands into the final two blocks, click the buttons below until they say Chain / Conditional / Always Active.
If you still want to use the falling block method, there are several problems that I see with your command.
You used escaped quotation marks(\”
) which are not needed in this case and cause a problem. You also used the wrong kind of quotation marks (”
vs "
)
You used the @s
target selector which targets the entity executing the command. The command block would output Entity '@s' cannot be found
. You will have to use an appropriate target selector. You could use @p
to target the player nearest the command blocks.
The first use of Passengers
(Passengers [{id:falling_block
) is missing :
.
The last command block command fill ~ ~-5 ~-1 ~~50 ~-1 redstone_block
has no space between x2 and y2(~~50
should be ~ ~50
). Also, the redstone blocks only need to be next to the blocks that need to be activated. With the current coordinates, you are producing a stack from one below the original command block, all the way to 50 above the last command block. I changed the fill coordinates to ~ ~-3 ~-1 ~ ~-1 ~-1
and it only puts the blocks where they are needed.
Another change. While it is not required to be changed, command block commands do not need to start with /
With all of these changes the command is:
summon falling_block ~ ~1 ~ {Block:command_block,Time:1,TileEntityData:{Command:"give @p minecraft:bow 1"},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:"give @p minecraft:arrow 64"},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:"tp @p 384.700 7 400.700"},Passengers:[{id:falling_block,Block:command_block,Time:1,TileEntityData:{Command:"fill ~ ~-3 ~-1 ~ ~-1 ~-1 redstone_block"},Passengers:[{id:falling_block,Block:redstone_block,Time:1}]}]}]}]}
Note:This will only successfully run one time. After that, the command blocks and redstone blocks are already in place so if you run it again, it will cause command blocks and redstone blocks to break and be dropped as items.
You could correct this by removing all of the command blocks and redstone blocks that were created by the original command block. Either manually or with another command block.
Pictures about "Problem with multiple commands in one Command Block"



Can you do multiple commands in one command block?
To make your command block run multiple commands, you will need to summon FallingSand or falling_block (depending on your version of Minecraft) with command blocks and redstone blocks for each command. The command blocks will be stacked one on top of the other and contain the individual command.How do you do multiple commands in one?
There are 3 ways to run multiple shell commands in one line:How do you put multiple items in one command block?
If want to give multiple blocks at once, you need to specify an Amount in the /give command. The amount goes after the Item that you are giving. Type the command in the chat window and press the Enter key to run the command.Do command blocks have a limit?
The text limit for commands in a command block is 32,500 characters, but the text pane can show only a small portion of this amount at a time. Commands in a command block do not need to be prefixed with the forward-slash ( / ) as they do in the chat window, but doing so still works.Run multiple commands with one command block! | *ALL VERSIONS*
More answers regarding problem with multiple commands in one Command Block
Answer 2
You don't need to escape the quotes, so you have to replace \”
and \\”
with "
. This also fixes that you used the wrong quotation marks (”
->"
).
Also you have to replace @s
with @p
to target the closest player instead of the command block itself (which would fail, because the command block isn't an entity anymore, but a block as soon as it touches the ground).
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Keira Burton, Ivan Babydov, Ivan Babydov, Anete Lusina