Redstone explained

How repeaters and comparators work

Repeaters and comparators both take a signal from behind and send one forward. A repeater renews and delays a signal. A comparator measures and compares. This is what each one does, tick by tick, in Java Edition 26.3.

What a repeater does

A repeater takes power from behind and powers the block in front of it at full strength, 15, however weak the signal that reached it. Redstone dust loses one level per block, so a long line needs a repeater at least every 15 blocks.

It only works one way. Power in front of it never flows back, so a repeater also keeps two lines apart.

Delay: 1 to 4 ticks

Use a repeater to switch its delay between 1 and 4 redstone ticks. One redstone tick is 2 game ticks, a tenth of a second, so a repeater set to 4 waits 0.4 seconds before it turns on, and again before it turns off.

A pulse shorter than the delay comes out as long as the delay: a 1-tick pulse through a repeater set to 3 leaves as a 3-tick pulse.

Locking a repeater

Point a powered repeater or comparator into the side of a repeater and it locks: it keeps its output as it is and ignores its input. When the side turns off, it catches up with its input. Locked repeaters are how redstone stores a bit, as in counters and memory.

What a comparator does

A comparator has an input at the back, two at the sides and a small torch in front that sets its mode. It changes its output 1 redstone tick after its inputs change, and like a repeater it works one way. Unlike a repeater, it keeps the strength it gets: 9 in, 9 out.

  • Compare mode (front torch off): it passes the back signal on if that signal is at least as strong as the stronger side, and gives nothing otherwise.
  • Subtract mode (use the comparator to light its front torch): it gives the back signal minus the stronger side, and never less than 0.

Reading chests and other blocks

With a chest, barrel, hopper, dropper or dispenser behind it, a comparator gives how full that container is: 0 when empty, 1 for a single item and 15 when full. In between it is 1 plus 14 times how full the container is, rounded down. Each slot counts as full when it holds a full stack of its item, so 16 eggs fill a slot, and so does one sword.

It reads through one solid block too, so the container can sit behind a wall.

Some blocks give a set level instead: a cauldron its water level (a lava cauldron gives 3), a composter how full it is (8 when ready), a respawn anchor more for each charge (15 at 4), and an end portal frame 15 when it holds an eye.

What they are used for

  • Long lines: a repeater every 15 blocks, or sooner.
  • Clocks and timers: repeater delays set the speed.
  • Item sorters: a comparator reading a hopper that holds filter items changes its signal when one more of that item arrives.
  • Counters and memory: locked repeaters hold their state.
  • Storage meters: a comparator shows how full a chest is.

Tested machines that use this

Open one to play with it in 3D, then download it for your world.

What our simulator checks

Contraptify’s simulator follows these rules, and these reference tests check them on every change. How we test.

Timing 6
  • repeater delay 1 turns on after 2 game ticks
  • repeater delay 2 turns on after 4 game ticks
  • repeater delay 3 turns on after 6 game ticks
  • repeater delay 4 turns on after 8 game ticks
  • a torch starts lit
  • a torch turns off 2 game ticks after its block is powered
Repeater locking 2
  • a locked repeater ignores its input
  • it catches up once unlocked
Comparators reading containers 11
  • an empty chest reads 0
  • one item in a chest reads 1
  • a chest with 2 full stacks reads 2
  • a full chest reads 15
  • a full barrel reads 15
  • a trapped chest with 14 stacks reads 8
  • a hopper with 1 full stack reads 3
  • a dropper with 9 eggs reads 1
  • 16 eggs count as a full stack (a dropper with 2 stacks of eggs reads 4)
  • one sword fills a hopper slot (reads 3)
  • a comparator reads a chest through a solid block
Comparators reading fixed levels 13
  • a cauldron with water level 2 reads 2
  • an empty cauldron reads 0
  • a lava cauldron reads 3
  • a composter at level 5 reads 5
  • a full composter reads 8
  • a respawn anchor with 1 charge reads 3
  • a respawn anchor with 3 charges reads 11
  • a respawn anchor with 4 charges reads 15
  • an end portal frame with an eye reads 15
  • an end portal frame without an eye reads 0
  • a comparator reads a cauldron through a solid block
  • a piston pushes a composter, which keeps its level
  • a piston can't push a respawn anchor

Want a machine that uses this?

Ask for it in plain words. An AI designs it, and our simulator tests it before you build it.

Design a machine