The Redstone Comparator is a complicated device in Minecraft. It has two operation modes, which can be toggled by right-clicking; the front torch indicates what mode it is in. Aside from these two actions, it has another two.
A vs. B
This part is simple, but vital to remember: When a signal comes in from the back (the side with two torches) it is Signal A. When it comes in from the side, it's Signal B.
This mode takes the inputs from the side and the back and subtracts B from A. It then puts out a signal of that strength. Example: A Daylight Sensor at high noon is right next to the back and a Redstone Torch, 11 blocks away, is powering the side. The output from the front will have a strength of 15-10 (5).
Comparison Mode is triggered when the front torch is dark. It takes the signals of A and B and compares them. If B is stronger than A, no signal passes through. However, if A is stronger than B, it continues through.
Use as a diode
Redstone Comparators, although they cannot repeat a signal like a Redstone Repeater, can prevent signals from traveling in one direction but allow them through in the opposite direction. This is handy to make sure a Hopper powering a Comparator doesn't get turned off by a rebound of power.
When the back end is placed against a container of any type (Chest, Trapped Chest, Brewing Stand, Furnace, Hopper, etc.) it will send out a signal based on the number of items in that container. This is handy for alarms when someone has stolen something out of your chest. However, Trapped Chests can function in the same way, although they will go off when you open it too.
|Liquids||Water • Lava|
|Redstone||Piston Extension • Redstone Wire • Redstone Torch (Off) • Redstone Lamp (On) • Redstone Repeater (On) • Redstone Comparator (On)|
|Plants||Nether Wart (Growing) • Potato (Growing) • Carrot (Growing) • Wheat (Growing)|
|Misc||Fire • End Portal (Block) • Nether Portal (Block) • Locked Chest|
|Crafted Blocks||Brick (Block) • Beacon • Redstone Torch • Block of Diamond • Block of Emerald • Block of Gold • Block of Redstone • Block of Iron • Block of Coal • Block of Lapis Lazuli • Flower Pot • Item Frame • Hopper • Dropper • Dispenser • Lever • Pressure Plate • Button • Door • Trapdoor • Polished Andesite • Polished Diorite • Slab • Bookshelf • Jack o'Lantern • Stained Glass • Stained Clay • Block of Quartz • Chest • Crafting Table • Furnace • Anvil • Enchantment Table • Ender Chest • Trapped Chest • Stained Glass Pane • Slime Block • Bed • Note Block • Sticky Piston • Redstone Lamp • Fence Gate • Redstone Repeater • Redstone Comparator • Powered Rail • Activator Rail • Boat • Minecart • Minecart with Furnace • Cake • Brewing Stand • Cauldron|