XNOR Gate Applications

An XNOR gate allows you to control a single redstone mechanism—such as a retractable bridge or hidden staircase—independently from two different levers. This setup is ideal for survival base defense, escape routes, and adventure maps, allowing you to open a path on one side and immediately close it behind you from the other side to block pursuers.

Logic GatesBeginnerJava & Bedrock
XNOR Gate Applications video tutorial

Video: Minecraft: Redstone - 3 Ways To Use XNOR Gates by g11g00g3r

How to build it

  1. Place the Entry and Exit Levers

    Install one lever at the start of your obstacle (such as a gap, lava pit, or wall) and a second lever at the destination on the opposite side. In a defense scenario, keep both levers hidden so only you know their locations.

  2. Build the Underground XNOR Gate

    Dig an underground room between the two levers and construct an XNOR logic gate using building blocks, redstone torches, and redstone dust. Run redstone dust lines from both levers into the two inputs of the gate.

  3. Application 1: Retractable Bridge

    Line the bottom of a trench or gap with upward-facing sticky pistons topped with floor blocks. Connect the single output line of your XNOR gate to these pistons so toggling either lever raises or lowers the bridge.

  4. Application 2: Pop-Out Staircase

    Place horizontal sticky pistons inside a wall in a stepped pattern, with stair or solid blocks attached to their faces. Wire the XNOR gate output to the pistons so pulling the bottom lever extends the stairs and pulling the top lever retracts them behind you.

  5. Application 3: Safe Room Escape Bridge

    Create a final narrow crossing leading to a secure platform using sticky pistons connected to another XNOR gate. Flip the entrance lever to extend the walkway, cross over, and flip the platform lever to drop the bridge and trap anyone chasing you.

How it works

An XNOR gate (or XOR gate, depending on whether the output is inverted) acts like a real-world three-way light switch when wired to two Levers:

  • Dual Input Control: An XNOR gate outputs a high redstone signal when both input levers are in the same state (both OFF or both ON), and turns OFF when the levers are in opposite states.
  • Toggling From Either End: Because flipping either lever always changes whether the two inputs match, flipping any lever at any time will always toggle the state of the connected Sticky Pistons.
  • Chase Defense: When you flip the first lever, the output turns ON and extends the bridge or staircase. Once you cross and flip the second lever, the inputs no longer match (or now match, depending on inversion), turning the output OFF and retracting the blocks behind you.

Tips & variations

  • Hide Your Levers: For survival base defense or PvP escapes, conceal the levers behind corners, trapdoors, or foliage so pursuers cannot simply flip the entry lever to re-open the bridge.
  • Signal Strength: Because the wiring has to travel from the entry side to the exit side underground, use Redstone Repeaters along the input and output lines so the signal does not run out after 15 blocks.
  • XNOR vs. XOR: In practical builds with two levers, an XNOR gate and an XOR gate behave identically—the only difference is which lever positions count as ON or OFF.

Frequently asked questions

Why do I need an XNOR gate instead of connecting two levers to the same wire?
If you connect two levers directly to the same redstone wire, whenever one lever is switched ON, the wire stays permanently powered and the second lever cannot turn it OFF. An XNOR gate ensures that flipping either lever always toggles the mechanism regardless of how the other lever is set.
What is the difference between an XOR gate and an XNOR gate for bridges?
An XNOR gate is simply an XOR gate with an inverted output. When using two levers to control pistons, both gates work the exact same way—flipping either lever toggles the bridge or stairs open and closed.
Where can I use these XNOR piston traps?
They work well for secret survival base entrances, PvP escape tunnels, and puzzle or adventure maps where players must toggle switches in sequence.

Components used

More xnor gate