A repeating command block in conditional mode (let's call it B) is placed after another command block with the SuccessCount set on 0 (this one is A).
When the command inside A is successfully executed, B do not activate. But if the command inside A is successfully executed the next tick, the command inside B is activated.
SETUP : A repeating command block in Need Redstone mode, with the command 'say 0'. In front of him, a repeating command block in Need Redstone + Conditional mode, with the command 'say 1'.. A button on top of the first command block.
[media]What I expected to happen was...:
When I trigger the button, the following numbers appears in the chat :
[@] 0
[@] 1
[@] 0
[@] 1
[@] 0
[@] 1
etc...
Because the first command block successfully executed its 'say 0' command, the following command block executes its 'say 1' command.
What actually happened was...:
The following numbers appeared in the chat :
[@] 0
[@] 0
[@] 1
[@] 0
[@] 1
[@] 0
[@] 1
etc...
Steps to Reproduce:
1. Place two repeating command blocks, both in "Need redstone" mode. The first one should point toward the back of the second.
2. Change the second command block's mode to "Conditonal" mode.
3. Enter the command 'say 0' in the first command block and 'say 1' in the second.
4. Place a button on one of the command block. Trigger it and watch the chat.
If you need to repeat this experiment, you need to remember that the first command block needs to has SuccessCount set on 0.
If you don't want to remember it, place a chain command block after the second command block, in "Always Active", "Unconditional" mode. Enter the following command inside :
blockdata x y z {SuccessCount:0}
with x, y and z the coordinates of the first command block.
If you don't want to set it up, take the World Download in the Attachments section.
EDIT : This works in every direction. The block powered by the button doesn't matter while both command blocks are powered the same time.
See this comment from Skylinerw for a possible fix.
EDIT 2 : Check this link if you think there is no bug. It will probably change your mind.
Linked issues
is duplicated by 1
relates to 2
Attachments
Comments 19
It works in every direction ; It works when the button is on the second command block (no matter the direction) too.
So it looks like there's an order, if the direction and the "powered direction" doesn't change it
It's not guaranteed to work. If it doesn't work, tough luck. Use chain command blocks if you want commands to be executed in a guaranteed order.
@redstonehelper I think the problem is real. If new command blocks are supposed to be more organized and allow us to give up repeaters and fill clocks, one basic thing like this should be consistant and clear, am I right ?
Also something to add:
Every check gets executed, just one tick late. Basically a conditional repeating command block gets executed if the condition of the previous command was met in the previous tick. So it is not only the case, that the repeating command block activates one tick late, it also deactivates one tick late.
An example to illustrate that behaviour:
r/c/i = repeating/chain/impulse
& = conditional
all of them always active
r
/testfor @p[r=10]
&c
/say 1
&r
/say 2
As you move to it and away again:
game output
[@] 1
[@] 1
[@] 2
[@] 1
[@] 2
[@] 1
[@] 2
[@] 1
[@] 2
[...]
[@] 1
[@] 2
[@] 2
So, at the end both the chain and the repeating command block have executed the same amount of times, the repeating command block was just always one tick behind.
This is still an issue in 1.13-pre1, although it may not be as relevant anymore since functions are a really good alternative by now
There is no defined order in which these two command blocks activate when pressing the button. The one on the left probably activated first.