How To Use Conditional Command Blocks



In this video, I explain everything you need to know about the conditional feature in command blocks.

When a command block is made conditional, it will only activate if the command block before it activated. For example, if I have a command such as "/execute if entity @e[type=item]" in a command block, and then a conditional command block after that containing "/say found item", it will only say "found item" in chat if the first command block found and item. If no item was found, the second conditional command block will also not get activated.

Conditional command blocks can also be used with completely normal commands, not necessarily "execute if" commands. For example if I have a command block containing "/setblock ~ ~1 ~ stone" and a second conditional command block containing "say stone", it will say "stone" in chat if it was able to place a stone block. But if there already was a stone block there, meaning that the command couldn't place a second stone block there, the conditional command block would not say "stone" in chat, since it wasn't able to place a stone block.

You can also have multiple conditional command blocks in a single chain of command blocks, but keep in mind that a conditional command block only cares if the block right before it activated, and it cares about nothing else, nothing before, nothing after.

Previous
Previous

How To Install Datapacks

Next
Next

Command Block Types