Minecraft piston pushing against each other

minecraft-java-editionminecraft-redstone

When two pistons face each other and powered simultaneously, which will push?

I am making a contraption that requires that this behavior be consistent, what it depends on is irrelevant as long as it is consistent.

After doing some testing, I came to the conclusion that it kinda depends on orientation and source of power (or the redstone connecting them), but not entirely. It is weird beyond imagination and I cannot find a general rule.

Pistons facing each other

In the image, the left actually always win except if the lever is placed on the rightmost block

Best Answer

There is no way to know for sure. This behavior depends on a number of factors, including the device location, rotation, and even your version of Java. This is because Minecraft uses Java's HashSet code to control redstone dust update order. The HashSet uses all properties of an object when deciding the order, and it changes between Java versions.

Technically, your game does follow rules, but if you wanted to predict which piston would get the signal first, you would need to be able to compute multiple hashes, which is infeasible to do by hand, and it would take less time to try it in game.

There is no easy way to predict which one extends first. Placing nearby redstone, moving your pistons, rotating the entire machine, updating Minecraft, switching computers, and changing the redstone input can all affect the way the pistons interact.

This is a bug in Minecraft. Here's a link to the bug in the bug tracker: MC-11193