Tutorials/Comparator update detector
The Comparator Update Detector, or "CUD switch", is a redstone mechanism that exploits a bug in the game in order to detect comparator updates. Comparator updates are updates that only update comparators, for example, interacting with a container. Block update detectors cannot detect comparator updates, but CUDs can detect block updates. There are many different designs, but they are all based on the same general idea: a comparator is turned on while it should be turned off, or the other way around. To get a comparator in such a state, you have to make sure that it doesn't realize that it should change. This can be done in several ways. When the comparator gets an update, it will realize that it should change state. This update can be a block update, or a comparator update. CUDs can detect comparator updates next to the comparator, but also 1 block in between, provided that the block in between is a solid block.
What it detects[edit | edit source]
The CUD switch detects everything a BUD detects, however the CUD can detect updates from the following blocks 2 blocks away from the comparator (but only if a solid block exists between the comparator and the target block). This means that you can have a CUD behind a wall that detects the following updates in front of the wall:
- Placement of chest, trapped chest, dispenser, dropper, furnace, hopper, brewing stand, jukebox, detector rail, cauldron, end portal frame, command block, sign
- Removal of chest, trapped chest, dispenser, dropper, furnace, hopper
- Interactions of chest, trapped chest, dispenser, dropper, furnace, hopper, brewing stand, jukebox, detector rail, Cauldron, end portal frame, command block, sign, note block, beacon
In this chart you can see everything the CUD detects: http://i.imgur.com/bIFRCTJ.png
Types of CUD Switches[edit | edit source]
The CUD can be only based on a comparator because only comparators can detect comparator updates. Each time you do one of the actions listed above, a comparator update is being sent 2 blocks away in all the 4 directions.
Chest based[edit | edit source]
This method uses the mechanics of a chest. When a chest is locked, the comparator doesn't realize that it shouldn't be turned on anymore. When you update the comparator, it realizes, and resets the system.
Using Solid Block[edit | edit source]
The idea is to use a solid block to block the chest. If you can't open the chest, you can't take a comparator output from it. The video showcases some different designs you could use (including a tileable design)
Using Cat[edit | edit source]
It's also possible to block the chest with a cat. When a cat sits on a chest, you can't open it. You can move the cat using pistons, minecarts or water. Using minecarts, you can make a silent CUD, besides the meow-sound of the cat.
Cauldron based[edit | edit source]
This method uses a filled cauldron that is being pushed by a piston, the comparator doesn't notice that the cauldron has been pushed down and stays powered until it gets an update. Note that the cauldron should contain water.
Redirecting based[edit | edit source]
This method is often used in BUD's. You can turn any repeater-based BUD into a CUD by replacing the repeater with a comparator. You can redirect redstone with a detector rail, redstone block or a solid block, blocking 2 redstone diagonal to each other. Again, the comparator doesn't realize that the redstone isn't pointing the right direction anymore and it will stay turned on until it receives an update.
Item frame based[edit | edit source]
Comparators can take a redstone output from an item frame, but only if the item frame's position isn't occupied by a block. Many blocks will break the item frame, if they are in the same position, but some blocks don't. Examples are water, fence gates, skulls and flowers.
Variations[edit | edit source]
Other devices can be built using the same underlying principle as the CUD switch. CUDs can be made stackable and even tile-able. They can be turned into a toggle-CUD. CUDs can be made pistonless using cats.
T-CUD[edit | edit source]
A T-CUD toggles between 2 states. The first update will turn the comparator off, and the second update will turn the comparator on again.
Why and how it works[edit | edit source]
History[edit | edit source]
The earliest known CUD-switch was made by RedsMiners. The bug it was based on has been fixed in Minecraft 1.5.
DvirWi found out that it detected clicking inside of chests.
Short time later, NiceMarkMC made a version (not knowing it was a CUD) that used DvirWi's technique.
NiceMarkMC then uploaded a video of DvirWi's version and called it TEUD to keep it shorter, and viewers suggested calling it DUD (Data Update Detector) which became a widely used name.
NiceMarkMC accepted the name DUD but then renamed it to CUD because the other names were technically incorrect.