Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

If I make some Command Blocks with commands (let's say say whatever), connect them with redstone dust (you can place redstone dust on Command Blocks by holding Shift), then produce a redstone signal to trigger them at the same time, is there a specific order in which they are executed? Does it depend on coordinates, directions, or what?

share|improve this question
2  
it'll be unpredictable, IIRC the redstone updates are put in a HashMap and then iterated over, so it'll depend on the size of the map (how many updates are triggered at the same time since the server started) and the coordinates –  ratchet freak Mar 17 '13 at 13:07
    
@ratchetfreak That sounds like an answer. –  SevenSidedDie Mar 19 '13 at 17:44

4 Answers 4

up vote 5 down vote accepted

This is not a good idea. If you have commands that must be executed in a specific order, separate them with repeaters or comparators so that they execute in a specific order.

If you trigger a lot of command blocks with interfering actions at the same time, they will execute in a specific order, but you can't know what this is in advance, it may change without notice (if the server is restarted for instance), and will almost certainly cause you a lot of headaches.

share|improve this answer

It starts with the lowest z coordinate, then runs them in order of increasing x coordinate, then starts again with the next z coordinate. I do not know how the y coordinate is involved.

share|improve this answer
    
Good answer! Do you have any references that prove your answer? –  Timtech Feb 24 '14 at 23:58

In fact, it is actually the lowest z, then executes that row of x, then goes +z by 1, then executes that row of x and so on... for y-execution, it goes bottom-up, so it starts at the lowest point, then goes to the lowest z point, the executes that row of x. It's actually not that hard, and really compact instead of a line of repeaters running from each command block.

share|improve this answer

If the command blocks trigger each other by placing and removing redstone blocks, wires, circuit-breaking opaque blocks and/or inputless torches, then they're predictable (at least as long as the chunks never unload -- see https://bugs.mojang.com/browse/MC-711). They'll be triggered from bottom to top, then from west to east, then north to south (ascending order of Y, then X, then Z), and a command block will run each game tick if its signal has switched from off to on at least once since it last ran. (The same rule applies to note blocks, which are the only type of output block that can run at more than 5 Hz.) This is what makes 20Hz /setblock clocks possible. It's only when you use repeaters, comparators, switching torches, or moving parts that the unpredictability arises.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.