Wiki ArticleLocal entity data availableRenewable resourcesStackable resourcesJava Edition specific informationBedrock Edition specific information

Redstone Comparator

A redstone comparator is a block that can produce a redstone signal from its front by reading chests, lecterns, copper bulbs, and similar blocks. It can also repeat a signal without changing its strength. It can also be to either stop outputting a signal while its side input is receiving a stronger one (front torch off), or output a weaker signal based on its side input's signal strength (front torch on).

Local game data

Unpowered Comparator

Bedrock 1.21.100
Typeitem
Stack1
Durability-
Sections6
Canonical IDitem:unpowered_comparator
Minecraft IDminecraft:unpowered_comparator
Wiki sourcecached

A redstone comparator is a block that can produce a redstone signal from its front by reading chests, lecterns, copper bulbs, and similar blocks. It can also repeat a signal without changing its strength. It can also be to either stop outputting a signal while its side input is receiving a stronger one (front torch off), or output a weaker signal based on its side input's signal strength (front torch on).

Breaking

A redstone comparator can be broken instantly with any tool, or by hand, and drops itself as an item.

A redstone comparator is removed and dropped as an item if: its attachment block is moved, removed, or destroyed; water flows into its space; a piston tries to push it or moves a block into its space. If lava flows into a redstone comparator's space, the redstone comparator is destroyed without dropping as an item.

Natural generation

2–9 Redstone comparators generate in ancient cities.

Usage

A redstone comparator can be placed on the top of any opaque block with a solid full-height top surface (including upside-down slabs and upside-down stairs). , a comparator can also be placed on walls and fences. For more information about placement on transparent blocks, see Opacity/Placement. The redstone comparator has a front and a back — the arrow on the top of the comparator points to the front. When placed, the comparator faces away from the player. The comparator has two miniature redstone torches at the back and one at the front. The back torches turn on when the comparator's output is greater than zero (the arrow on top also turns red). The front torch has two states that can be toggled by the comparator: Down and unpowered (indicating the comparator is in "comparison mode") Up and powered (indicating the comparator is in "subtraction mode") The redstone comparator can take a signal strength input from its rear as well as from both sides. Side inputs are accepted only from redstone dust, block of redstone, redstone repeaters, other comparators, and observers in specific scenarios. The redstone comparator's front is its output. It takes for signals to move through a redstone comparator, either from the rear or from the sides. This applies to changing signal strengths as well as simply to turning on and off. Redstone comparators check their power state before their scheduled ticks update. This results in redstone comparators not usually responding to 1-tick fluctuations of power or signal strength — for example, a 1-clock input is treated as always off from the side, and always on from the rear. This happens because the signal changes back to its original state before the redstone comparator checks its input states. However, certain setups such as powering any input with two separate observer pulses at the same time causes a redstone comparator to respond to 2-game-tick pulses. The redstone comparator has four functions: maintain signal strength, compare signal strength, subtract signal strength, and measure certain block states (primarily the fullness of containers).

Maintain signal strength

A redstone comparator with no powered sides outputs the same signal strength as its rear input, with a 1 redstone tick (= 2 game ticks) delay.

Compare signal strength

A redstone comparator in comparison mode (front torch down and unpowered) compares its rear input to its two side inputs. If either side input is greater than the rear input, the comparator output turns off. If neither side input is greater than the rear input, the comparator outputs the same signal strength as its rear input. The formula for calculating the output signal strength is as follows: output = rear × [left ≤ rear ANDright ≤ rearWikipedia:Iverson bracket|]

Subtract signal strength

A redstone comparator in subtraction mode (front torch up and powered) subtracts the signal strength of the greater side input from the signal strength of the rear input. output = max(rear − max(left, right), 0) For example: if the signal strength is 6 at the left input, 7 at the right input and 4 at the rear, the output signal has a strength of max(4 − max(6, 7), 0) = max(4−7, 0) = max(−3, 0) = 0. If the signal strength is 9 at the rear, 2 at the right input and 5 at the left input, the output signal has a strength of max(9 − max(2, 5), 0) = max(9−5, 0) = 4.

Local Data Properties

displayNameUnpowered Comparator
nameunpowered_comparator
id10743
stackSize1