These two blocks look similar but perform quite different functions in redstone circuits in Minecraft.
Comparators look similar to repeaters, but have some quite different functions.
The crafting recipe is similar too, except you’ll need a piece of Nether Quartz.
Here’s a rundown of what you can do with a comparator:
Like a repeater, a comparator allows the current to flow through it only in one direction: in the back, in the front, marked with an arrow at the top.
Unlike a repeater, the signal is neither delayed nor amplified.
Comparing current strengths
As the name suggests, a comparator can compare the strength of two currents. Compare the main signal which receives through the rear (base of the arrow) with a signal passing through the side and outputs it through the front.
The signal entering the rear will be output from the front if it is greater than the signal entering the side. If the repeater receives a signal from both sides, simply use the one that is stronger and ignore the other.
The main signal will not be altered in intensity.
If you right-click the comparator, this will put it into subtraction mode. This is signaled by the lighting of one of the three front redstone torches (the small one).
In subtraction mode, the comparator works as described above, except that the current output at the front is equal to the main input minus the side input. That is, the strength of the passing main current will be reduced by the strength of the side current (to zero if the side current is greater than the main current).
Indication of the fullness of the containers
If the base of a comparator is placed against a container (chest, oven, hopper, dropper, dispenser, brewing stand or juke box), it will emit a current with a force that depends on how full the container is. This can be used to check if a container is empty or to compare how full two different containers are.
Comparators can also operate in normal or subtract mode in this role, allowing all kinds of complicated calculations to set thresholds for comparison.
How does signal strength relate to how full the container is?
This is quite complicated, as each type of container has a different number of slots and different objects can be stacked differently. The output current is 0 for a completely empty container and 15 for a full one.
A beer brewing stand has 3 bottle slots and the bottles don’t stack, so each bottle is worth a third of the maximum signal strength, i.e. 5 each.
A large chest can hold 3456 of any block that can stack up to 64 items per slot, so each item is worth a lot less than the bottles in a brewing stand! Items that don’t stack, like tools or boats, count for a whole stack each, and a whole stack of 16 eggs is worth the same as a whole stack of 64 of something.