-
Bug
-
Resolution: Unresolved
-
None
-
Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w48a, Minecraft 17w49a, Minecraft 17w49b, Minecraft 17w50a, Minecraft 18w03b, Minecraft 18w05a, Minecraft 1.13-pre3, Minecraft 1.13-pre6, Minecraft 1.13-pre7, Minecraft 1.13, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w04b, Minecraft 19w05a, Minecraft 19w06a, Minecraft 1.14, 1.14.4, 1.15 Pre-release 1, 1.15.2, 20w09a, 20w19a, 20w21a, 1.16 Release Candidate 1, 1.16, 1.16.1, 1.16.4 Pre-release 2, 20w45a, 20w51a, 21w03a, 1.16.5, 21w07a, 1.17.1, 21w39a, 1.18 Release Candidate 4, 1.18, 1.19, 1.19.2, 1.19.3, 23w04a, 1.19.4 Pre-release 2, 1.20.2, 23w43a, 23w43b, 1.21, 1.21.3
-
Confirmed
-
Redstone
-
Normal
-
Platform
This is a compilation of instances were comparators do not update their power level correctly when a block with a comparator input override changed.
Affected blocks
- beehive / bee nest
- placed (behind block)
- broken (behind block)
- brewing stand
- placed (behind block) using command /setblock x y z brewing_stand{Items:[{Slot:0b,id:"potion",Count:1b}]}
- broken (behind block)
- cake
- placed (behind block) using command /setblock x y z cake (Does update if placed manually)
- broken (behind block)
- completely eaten up (behind block)
- cauldron
- placed (behind block) using command /setblock x y z cauldron[level=3]
- removed (behind block)
- filled by rain
- chest
- placed (behind block) using command /setblock x y z chest{Items:[{Slot:0b,id:"stone",Count:1b}]}
- command block
- placed (behind block) using command /setblock x y z command_block{SuccessCount:1}
- broken (behind block)
- compost
- removed (behind block)
- detector rail
- broken (behind block)
- dispenser
- placed (behind block) using command /setblock x y z dispenser{Items:[{Slot:0b,id:"stone",Count:1b}]}
- dropper
- placed (behind block) using command /setblock x y z dropper{Items:[{Slot:0b,id:"stone",Count:1b}]}
- end portal frame
- placed (behind block) using command /setblock x y z end_portal_frame[eye=true]
- broken (behind block)
- furnace
- placed (behind block) using command /setblock x y z furnace{Items:[{Slot:0b,id:"iron_ore",Count:1b}]}
- hopper
- placed (behind block) using command /setblock x y z hopper{Items:[{Slot:0b,id:"stone",Count:1b}]}
- item frame
- broken (by piston or command, left click would first remove the item)
- In case
MC-45619is intended: If a block inside of the item frame is removed
- jukebox
- broken (behind block)
- respawn anchors
- explodes (behind block)
- sculk sensors
- broken (behind block) →
MC-208715
- broken (behind block) →
- cats ->
MC-273741- standing up
- sitting down
Explanations:
- (behind block): The comparator must detect the affected block through a solid block to not update in the described situation.
- placed: Comparator does not update when the affected block is placed.
- broken: Comparator does not update when the affected block is broken. Also applies for being moved away by a piston.
- changed: Comparator does not update when the affected block changes its comparator input override.
Here is a video with a few examples when this bug happens. Note that it doesn't make any difference whether a block is moved by a piston or removed by a player. Some blocks however cannot be moved by pistons.
https://youtu.be/OZ_P68JvPQQ
That's every block and issue I could find related to this. If I missed something, please let me know down below.
Code Analysis
This is based on a decompiled version of Minecraft 1.12 using mcp 980.
Breaking/Moving block
In net.minecraft.world.World.setBlockState(BlockPos, IBlockState, int) there is some code that is meant to update comparators when a block with a comparator input override is placed and the flag for block updates is set. In there, you could also cause updates if a block with comparator input override is removed, however there are some cases where the update flag is not set and instead the net.minecraft.world.World.notifyNeighborsOfStateChange(BlockPos, Block, boolean) method is called instead.
So my proposed fix would be to remove the following
if (!this.isRemote && (flags & 1) != 0) { this.notifyNeighborsRespectDebug(pos, iblockstate.getBlock(), true); //remove this if (newState.hasComparatorInputOverride()) { this.updateComparatorOutputLevel(pos, block); } }
and instead add this to net.minecraft.world.World.notifyNeighborsOfStateChange(BlockPos, Block, boolean)
IBlockState newState = getBlockState(pos);
if(blockType.getDefaultState().hasComparatorInputOverride() || newState.hasComparatorInputOverride())
{
updateComparatorOutputLevel(pos, newState.getBlock());
}
Some code that becomes redundant after applying that fix also should be removed. That would be to remove worldIn.updateComparatorOutputLevel(pos, this); :in the following methodes
- net.minecraft.block.BlockChest.breakBlock(World, BlockPos, IBlockState)
- net.minecraft.block.BlockDispenser.breakBlock(World, BlockPos, IBlockState)
- net.minecraft.block.BlockFurnace.breakBlock(World, BlockPos, IBlockState)
- net.minecraft.block.BlockHopper.breakBlock(World, BlockPos, IBlockState)
- net.minecraft.block.BlockShulkerBox.breakBlock(World, BlockPos, IBlockState)
An alternative would be to override the net.minecraft.block.Block.breakBlock(World, BlockPos, IBlockState) in all the classes that have a comparator input override as proposed by marcono1234 in this comment. But it might be cleaner to apply the fix above since you don't need to remember to override the method when adding a new block with a comparator override.
Another alternative might be to add a class that all blocks with a comparator input override need to extend in which the net.minecraft.block.Block.breakBlock(World, BlockPos, IBlockState) method is already overridden.
Cauldron being filled by rain
Code analysis by marcono1234 can be found in this comment
- is duplicated by
-
MC-11919 Comparator does not update properly with minecart on a detector rail, stays on
- Resolved
-
MC-16716 Comparator powered from a cake/cauldron through a block, doesn't update when cauldron is removed by a piston.
- Resolved
-
MC-18461 comparator stays activated when powered by detector rail through a block and detector rail is displaced by piston
- Resolved
-
MC-18770 Cauldron Comparator Update
- Resolved
-
MC-19230 Comparator not updating when Endportal frame with ender eye is destroyed
- Resolved
-
MC-19451 Cauldrons will not activate comparators if they naturally fill up to the lowest or second lowest water level
- Resolved
-
MC-19709 When rain fills a Cauldron, The comparator does not update.
- Resolved
-
MC-21378 Cauldrons do not update comparators when filled by rain
- Resolved
-
MC-23768 Comparator doesn't update if a cauldron is filled by rain
- Resolved
-
MC-40663 When filled with rain, cauldrons with a comparator wont output a redstone signal
- Resolved
-
MC-48017 Redstone output of item frame not updating when destroying item frame by piston / killing by /kill @e[type=ItemFrame]
- Resolved
-
MC-48787 Killing Item Frame Doesn't Update Comparator
- Resolved
-
MC-50664 Bug with comparators not being able to detect water level from rain
- Resolved
-
MC-64700 comparator doesn't update when powered by a cauldron trough a block and the cauldron gets pushed with a piston
- Resolved
-
MC-77657 Comparator doesn't update when the cauldron that is powering the block move away by a piston
- Resolved
-
MC-86121 Comparators stuck
- Resolved
-
MC-105382 Cauldron won't update comparators next to it when it gets filled by rain
- Resolved
-
MC-111450 Comparators won't update it's state when a cauldron gets filled by rain
- Resolved
-
MC-117689 Comparator Doesn't Update When detecting signal through block
- Resolved
-
MC-119243 comparator reading full cauldron through a block does not update when removing cauldron
- Resolved
-
MC-121920 /data merge doesn't update comparators that point away from command_ block
- Resolved
-
MC-123505 Im not sure if thats a bug
- Resolved
-
MC-124671 Comparator doesn't update until block update
- Resolved
-
MC-134355 Comparators won't update when cauldron moves.
- Resolved
-
MC-138123 Cauldron moved via Slimeblock or Piston not updating Comparator signal if Comparator is not adjacent to cauldron
- Resolved
-
MC-142748 Comparators don't update if the movable block it was powered from gets broken or moved
- Resolved
-
MC-143787 the comparator doesn't update through blocks, cauldron, compost bin.
- Resolved
-
MC-150663 Destroying a lectern does not update comparators through a block
- Resolved
-
MC-152156 Comparator Update Glitch
- Resolved
-
MC-156560 Comparators don't turn off
- Resolved
-
MC-158307 Dying near item sorter causes the comparator reading the filter hopper to stop updating
- Resolved
-
MC-163699 Comparator output doesn't update if chest gets locked/unlocked.
- Resolved
-
MC-166054 Incorrect comparator output from locked chests
- Resolved
-
MC-175854 Comparator doesnt update when source block is moved from behind solid block
- Resolved
-
MC-182849 Bug Powered Comparators
- Resolved
-
MC-185146 Comparators need update when reading beehive through block
- Resolved
-
MC-186899 Comparator taking output from hopper minecart on detector rail through a block does not update when detector rail is removed
- Resolved
-
MC-190565 Exploding a respawn anchor doesn't update a comparator.
- Resolved
-
MC-191964 Comparators not Updating Upon Cauldron Retraction
- Resolved
-
MC-204151 Comparator being powered till block update
- Resolved
-
MC-208715 Comparator stays powered when powered by a block powered by a broken Sculk Sensor
- Resolved
-
MC-209052 Comparators retain power with sculk sensors
- Resolved
-
MC-213308 Comparator does not update correctly
- Resolved
-
MC-224204 Comparator gives output even after cauldron is removes
- Resolved
-
MC-231669 pistons interact weirdly with comparators
- Resolved
-
MC-233563 Comparator detects nothing
- Resolved
-
MC-238113 Comparators do not update when a composter/cauldron is pushed away
- Resolved
-
MC-254272 Comparator gives output after a output giving block is moved when behind a block
- Resolved
-
MC-255818 Comparator cake bug
- Resolved
-
MC-259514 Sculk Sensor Still Gives Redstone Signal After
- Resolved
-
MC-259592 Breaking an empty Chiseled Bookshelf does not update comparators through blocks
- Resolved
-
MC-260352 Detector rail+comparator works unreliably
- Resolved
-
MC-266160 Comparator doesn't properly react to Piston moving Copper Bulb
- Resolved
-
MC-266278 Copper bulb continues powering comparator through block after breaking
- Resolved
-
MC-273741 Cat sitting down/standing up on chest doesn't update comparator
- Resolved
-
MC-274945 Redstone comparator fails to update in a certain configuration
- Resolved
- relates to
-
MC-94566 Breaking non-container comparator-enabled blocks doesn't send a comparator update through blocks
- Open
-
MC-265901 Comparator sometimes doesn't update when crafting with the Crafter
- Resolved
-
MC-8340 Comparators do not update their state when blocking or unblocking a chest with a block on top
- Reopened
-
MC-11434 Comparators don't update properly when used with double chests
- Reopened
-
MC-12211 Comparator in subtraction mode does not update visually under certain conditions
- Resolved
-
MC-122159 Container inventory changes don't update nearby comparators
- Resolved