
Video: Programmable Logic Gate [Redstone] [Java] by Vortex Warp
How to build it
- Build the Four Identical Slices
This design consists of four identical 1-wide slices placed side by side, representing the four possible states of two inputs. Build the first slice's piston and comparator framework, then replicate it three more times.
- Run the Observer Lines
Place chains of observers running horizontally across the slices to carry the input and programming pulses. You can omit the observers on the very last slice space where the signal no longer needs to travel further.
- Position and Fill the Cauldrons
Each of the four slices uses a full cauldron pushed by a sticky piston to store memory states. Fill all four cauldrons with water, and set their default resting positions so the two outer cauldrons are pushed up and the two inner cauldrons are pushed down.
- Configure the Default Block Positions
Set up the input decoding pistons for the four slices. When both input levers are in their default off (up) positions, make sure the two outer slices have their blocks extended and the two inner slices have their blocks retracted.
- Attach Inputs and the Programming Trigger
Place your two main input levers at the front of the circuit to control the state selection. Add a third tertiary input (such as a button or redstone line) connected to the observer programming line to toggle the active state's memory.
- Connect the Output Lamp
Merge the comparator outputs from the four slices into a single redstone line at the back. Run this line into a solid block or directly into a redstone lamp to display the final logic gate output.
How it works
A two-input logic gate has four possible input combinations: 00, 01, 10, and 11. This circuit dedicates one physical slice to each of those four states:
- State Selection: The two main input levers shift solid blocks and cauldrons across the four slices. For any combination of the two levers, only one corresponding slice is aligned to allow its signal to pass through to the output.
- Memory Storage: Each slice contains a toggleable memory cell (driven by pistons and full cauldrons read by comparators) that remembers whether the output should be ON or OFF for that specific input state.
- Programming: To program the gate, you set the two input levers to a specific combination (for example, both ON for an AND gate) and trigger the third programming input. This flips the memory state for only the currently active slice. By repeating this for whichever states you want to output true, you can form an AND, OR, XOR, or any of the 16 possible two-input truth tables.
Tips & variations
- Java Edition Mechanics: This compact slice design relies on Java Edition piston and observer behavior (such as 1-tick pulse spitting with sticky pistons) to toggle the cauldron memory cells reliably.
- Initial Alignment: Double-check the default state before programming: with both levers up, the outer two cauldrons should be up, the inner two cauldrons down, and all four cauldrons must have water in them so the comparators can read a signal.
- Automated Reprogramming: The third programming input doesn't have to be pushed by a player—hook it up to another redstone circuit to change your machine's logic gate behavior automatically mid-operation.


