I'm making a map type thing where you have to get through challenges to win a prize. The problem is that I need to spawn a command block stack, I know who to spawn a command block with a command but I also need to change it so that the command block is set to chain and always active. This is the current command I'm using,
/setblock -585.601 68.00000 -471.700 command_block 0 replace {Command:"/playsound block.piston.extend voice @p"} 1 3 Answers
The things you are looking for are the blockstate (+8 if you want it to be conditional, as @Venya pointed out) and the chain command block, which goes by the name chain_command_block instead of a regular commandblock.
The other thing you're looking for is {auto:1}, the tag that makes the command always active.
So the complete command would be:
/setblock -585.601 68.0 -471.7 chain_command_block 8 replace {Command:"/playsound block.piston.extend voice @p",auto:1}(I removed the unneccessary numbers from the coordinates as well)
0I haven't been able to test anything yet, but this should have everything you need
when I get a chance, I'll test it in 1.11
from a little bit of reading it seems like 0-5 are the six directions, and 8-14 are the directions with conditional mode on
note: the directions should be down, up, north, south, west, then east
You need to put repeating_command_block instead of command_block for a repeating commandblock and chain_command_block instead of command_block for a chain one.