Java Edition.png

Java Edition:Redstone Comparator With Invalid Signal Strength

From Minecraft Discontinued Features Wiki
Jump to navigation Jump to search
Active_Redstone_Comparator.png

Comparators are a unique redstone component as it is the only one that uses NBT, unlike redstone dust which use data values to store it's signal strength, the comparator uses NBT. The reasoning behind comparators using NBT is because the shape of the redstone is determined by the client by seeing what redstone dust is next to it so only the signal strength is required to be stored, but the direction of a comparator is needed to be stored server side because the client needs to be aware of it, data values are 0-15 and that's 16 states. To store every possible state of a comparator you would need 16*4*2 or 128 states (16 for signal, 4 for direction, 2 for sub mode), so NBT is used for the signal strength, and data values for the direction and sub mode. Although 1.13 uses block states removing the 16 state cap of blocks, comparators continue to use NBT to store the signal strength. Signal strength from containers is calculated from the items inside and the way a full stack is determined is from the max stack size from "normal" game-play so one sword counts as one stack, so stacked swords are considered to be 64 stacks. This is already enough to make the signal strength considerably higher than 15.

Obtaining

Overstacked Items

Comparators with signal strength greater than 15 can be created by using many glitches that create overstacked items, this is because this can allow the calculation that determines the signal strength to be tricked into thinking there is more than one item stack in one slot as it goes above normal stack limits. 64 stacks of snowballs, enderpearls, eggs, ect. will count as 4 item stacks because it's 4 times what it can normally stack to which is 16. 64 stacks of sword, hoes, armor, shears, ect. count as 64 item stacks because they can normally only stack up to 1. Containers with more swords than there are item slots will cause it to create a signal strength greater than 15 when a comparator reads from it. A container filled with 64 stacks will get the signal strength 897 while a container filled with 127 stacks will output 1779 signal strength.

Subtract Mode

A comparator with signal strength greater than 15 can have signal strength subtracted from it if put in subtract mode, this will properly decrease the nbt signal strength by the right amount, this allows for possible signal strengths that may get skipped due to the calculation of signal strength from containers.

Signal Strength Calculation

Containers

Comparator signal strength calculation.png

Note: if the amount of stacks is greater than (N - 1) times 127 (or 64 depending on the version) you won't be able to add the b items since there will not be enough slots and will need to add an extra unstackable item. If the total number of slots of a container is also under 14 than specific signal strengths will be skipped.

To avoid doing all the math yourself you may instead choose to use the signal strength calculator provided on the mcdf tools website.

See also