Minecraft – How to stop a always running command block

minecraft-commandsminecraft-java-edition

I have a command that is constantly running. I used the new button "always active", but I don't know how to turn it off through another command block. Is there a way? Also, if there isn't, then is there a way to make a command block constantly run, but not with "always active"?

Best Answer

You can use /blockdata to change a command block to Needs Redstone:

/blockdata X Y Z {auto:0b}

And to change it back to Always Active:

/blockdata X Y Z {auto:1b}

Alternatively, make the command block Conditional, which means that it will only run if the command block behind it was successful last time in ran:

Conditional

Here, the chain block will only run if whatever's in the repeat block was successful.