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.

A door that needs the right answer

Levers in the right pattern is the simple version

A row of levers wired so that only one arrangement completes the circuit is a working lock and takes only dust and torches. Its weakness is that the wrong combinations leave the door quietly shut with no penalty, so a patient guesser gets in eventually.

Item frames give you eight positions each

A comparator reads item frame rotation as one of eight values, so three frames give more combinations than a row of levers ever will, and the frames look like decoration. This is the version worth building on a server where people expect a lock.

Reset the input after every attempt

A lock that keeps its last state tells the next person how close they got. Wiring the inputs to clear themselves after a failed attempt, or after a short delay, is what turns a puzzle into an actual lock.

Blocks and items in this guide

Redstone Torch in MinecraftRedstone TorchRedstone Dust in MinecraftRedstone DustComparator in MinecraftComparatorItem Frame in MinecraftItem FrameIron Door in MinecraftIron DoorPainting in MinecraftPaintingRedstone in MinecraftRedstonePiston in MinecraftPiston

All 8 of these are named in the guide above, starting with Redstone Torch. Look them up in the item database.

More guides on this site

Guides that go with this one

How to Make a Piston Extender in MinecraftA piston extender chains pistons to push a block further than one piston can reach. Here is what you need,...How to Make a Secret Door in MinecraftA secret door looks like a normal wall until you trigger it, then sticky pistons slide it open. Here are the...How to Make an Auto Brewer in MinecraftAn auto brewer feeds a brewing stand with hoppers so potions brew and collect on their own. Here is what you...How to Make an Allay Item Farm in MinecraftAn allay item farm uses allays to collect one item type and drop it at a note block into a chest. Here is...How to Make an Item Trash Can in MinecraftAn item trash can destroys junk you drop in using a cactus or lava, with unlimited capacity. Here is what you...How to Make a Cobblestone Generator in MinecraftA cobblestone generator makes endless cobblestone where lava meets water. Here is what you need, how the...

Related tools & databases

Tool
Crafting Recipes
Visual crafting grid for every recipe in the game.
Database
Item Database
Every item with its stats, IDs, recipes and uses.
Tool
Minecraft Tools
Calculators and generators for servers and players.
Guides
More Farms & Redstone guides
Auto farms, contraptions and every redstone component explained.