Minecraft – How to control two pistons facing each other at the same time in Minecraft java edition

minecraft-java-editionminecraft-redstone

I'm trying to create a door for my villager breeder. I want the lever to retract the rail and extend the stone and vice versa with one lever.enter image description here

Best Answer

you have two options: observers and taking advantage of a trick double piston extenders use. with observers, have a redstone line over them that they "look" into and power the pistons that are directly below them so that they "spit" the blocks out

image of what i am attempting to describe

if you can't make observers, have one piston(either one, doesn't matter which) have both a direct redstone line and a 2 repeater(that is, a repeater in its second position) face into a line powering the block the torch is on, which cannot be in direct contact with the piston. the other piston has a 2 repeater facing into it. done right, the side that has a torch should extend first and retract last. note that this implementation is also slower second design for same thing

note that this is not an exhaustive list, i could probably come up with more compact designs over time, but one relies on java being buggy, and the other relies on actual logic. if you were to make an improved design, base it off of the idea of the second one, not the first

the reason your design doesn't work is because of three simple issues: you're powering both pistons with the line that is meant to disable the redstone torch. two, you're not powering the block that holds the redstone torch, meaning it will not turn off. three, if those two issues would solve, the first piston would "jam" because you cannot have two pistons moving blocks in the same spots at the same time- one piston will wait for the other to move then only move after it realises it's powered by updating a block adjacent to it. it's more effective to just avoid this than trigger a block update in this scenario.