How to Use Redstone Comparators in Minecraft

By Jacob Cordeiro

The tricky device known as a redstone comparator has many different properties and capabilities for your Minecraft needs. It compares two different redstone currents — one is behind the comparator, and one is to the side. The comparator has two settings: One passes on the back current only if it exceeds the side current; another takes the difference of the two currents’ strength. This can be difficult to understand right away.

image0.jpg

The redstone comparator looks a lot like the redstone repeater, and it can be placed in the same way: It has a front for output and a back for input, and it can only be placed on most solid blocks. However, rather than have a torch on a slider in the back, it has two torches in the back corners.

Understanding the essential comparator function

The simplest property of a redstone comparator is that, unlike the redstone repeater, the charge going in is as strong as the charge coming out. For example, if redstone dust travels 8 blocks into a comparator, the output can travel another 7 blocks before reaching the 15-block limit.

image1.jpg

When working with redstone comparators, charge is vital. You may recall that redstone dust has a lower charge the farther it gets from a power source. The value of this charge affects how comparators function.

When a powered redstone dust, repeater, or comparator is directed into the side of a comparator, the comparator’s output is affected. However, the effect depends on the comparator’s setting. As with the redstone repeater, you can press the Use Item button (which is the right mouse button) to change the comparator’s settings. This action toggles the setting of the torch in front of the capacitor between On and Off.

image2.jpg

The redstone comparator has one property that functions regardless of the comparator’s setting: It doesn’t provide an output if the charge going into the side is stronger than the charge going into the back.

For example, if redstone dust reaches both the side and back of a comparator but the path to the side is shorter, the comparator’s output always has a charge of 0. However, when the side charge is less than or equal to the back charge, two things can happen:

  • If the comparator’s front torch is in the Off position, the output has the same charge as the input. Simple, right?

  • If the comparator’s front torch is in the On position, the output’s charge is equal to the input charge minus the charge going into the side. For example, if the charge on the side is 8 and the charge on the back is 11, the output has a charge of 11– 8 = 3.

This concept has many different applications. You can compare two numbers by connecting charges to the back and side of a comparator. You can use them to create specific levels of charge and then manipulate and combine them to produce the results you want. Here, you can see a simple lock, a machine that produces a charge of 1, and a setup that rapidly changes between powered and unpowered.

image3.jpg

Using comparators with containers

The comparator has another useful function, which makes it especially practical. If you place a comparator next to any container (such as a chest or a dispenser) so that the container is behind the comparator, a signal is produced proportional to how full the container is.

For example, a full container provides a charge of 16 to connected comparators, and a container with a small number of items (but not 0) produces a charge of 1. The other charges are spaced evenly throughout — thus, if a chest (which has 27 slots) contains seven swords, it produces 7/27 of a full charge.

However, different items are treated differently, storage-wise. Recall that most items can be placed in stacks of 64; in other words, 64 units of the same block can be put into a single slot of a chest. Items such as swords, meanwhile, completely fill whichever slot they occupy. For example, if you put, say, 32 diamonds into a chest, the comparator acts as though the slot is only half full.

You can use this property in many different ways, from comparing the contents of chests to manipulating objects such as hoppers.