1

I am on Windows 10 1.16.1 Minecraft I have a line of three command blocks: An unconditional impulse that needs redstone, A conditional chain that is always active, An unconditional chain that is always active

Impulse
Unconditional
Needs Redstone

Command Input:
testforblock 68 5 21 redstone_block

Previous Output:
The block at 68,5,21 is Air (expected: Block of Redstone).

Chain
Conditional
Always Active

Command Input:
tag @p add Blue

Previous Output:
Added tag 'Blue' to Vain Alibi

Chain
Unconditional
Always Active

Command Input:
execute @e[type = armor_stand, name = "Blue Room"] ~ ~ ~ title @p actionbar You've chosen §6Kapkan

Previous Output:
Title command successfully executed

After powering the impulse, I don't get the tag added to me, as expected because the impulse fails, and the first chain is conditional, but somehow the title from the second chain still shows. I can confirm that the block the first command block is searching for is NOT there, and that when I check my tags afterwards, I do NOT get the tag. Though somehow the title still shows, does anybody know how this is possible?

1 Answer 1

3

When a conditional chain command block doesn’t run (like your test example), it doesn’t stop the entire command chain, it merely skips the command and moved on to the next step. So this is what happens:

  1. /testforblock 68 5 21 redstone_block
    
    Fails, the block is Air.
  2. /tag @p add Blue
    
    Does not run. The first command block failed, but moving onto the next step anyway.
  3. execute @e[type = armor_stand, name = "Blue Room"] ~ ~ ~ title @p actionbar You've chosen §6Kapkan
    
    Runs. This command block is not conditional, so it always runs.

In your case, you’ll need to make the 3rd command block conditional so that it doesn’t run if the 1st one fails.

2
  • If the third command block is conditional, wouldn't it refer to the second command block to check if the tag was added and run based on that?
    – vain_alibi
    Commented Jul 23, 2020 at 5:18
  • 1
    @vain_alibi It would refer to both, and check if both of the earlier command blocks succeeded. You can only choose both or neither.
    – One 2 Many
    Commented Jul 23, 2020 at 17:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .