Skip to main content
← All Guides
Redstone · Contraption · Java & Bedrock

How to Make a Combination Lock

A combination lock wires a row of levers so that only one secret ON/OFF pattern powers the door. Get the code right and the vault opens; a single wrong lever and nothing happens.

SET CODE
ENTER CODE✗ DENIED✓ GRANTED
CHECK
set a secret ON/OFF pattern door opens only on the match
Wire levers so that only one ON/OFF combination powers the door. A wrong pattern is denied; the exact secret code unlocks the vault.

What you need

Levers (the input)
Redstone dust to wire
Redstone torches (to invert)
An iron door to lock

The AND-and-invert trick

A lock is just an AND of every lever: the door only powers when all of them are in their right state. For positions that should be OFF in your code, run that lever through a redstone torch first, which flips it so OFF reads as correct. The result is one pattern that opens the door and thousands that do not. Hide the levers, drive a piston door, and you have a real vault.

Quick answers

How does a combination lock work in Minecraft?
You wire a row of levers so that only one exact ON/OFF pattern completes the circuit to the door. The lock checks every lever at once: get the whole pattern right and the door opens; a single wrong lever leaves the circuit dead.
How do you build a lever combination lock?
AND the levers together so power only reaches the door when all of them agree. For the positions that should be OFF in your code, run that lever through a redstone torch first so its OFF state counts as 'correct'. The result is one secret pattern that powers the door.
How many combinations can a lever lock have?
Two to the power of the number of levers. Four levers give 16 combinations, eight levers give 256, and ten give over a thousand. More levers means a far harder code, at the cost of a bigger circuit.
Can I make a wrong guess lock people out?
Yes. Feed a 'wrong attempt' pulse into a counter or a T-flip-flop so that after a set number of misses the whole panel powers down, or trips a piston that seals the levers away until you reset it.
What is the best way to hide a combination lock?
Put the levers behind a painting or in an unrelated room, label nothing, and have the output drive a hidden piston door rather than an obvious iron door. A lectern page code or item-frame lock hides even better.
Do combination locks work on Bedrock?
Yes. The lever and redstone logic is the same, but redstone timing and quasi-connectivity differ between editions, so a torch-and-piston design tuned on Java may need small tweaks on Bedrock.
Database →
Levers & redstone
Look up levers, redstone torches and doors and how they wire together.
Guide →
Use a redstone torch
The inverter that turns an OFF lever into a correct input.