The bug
When ice/snow melts, sculk sensors nearby don't detect this, although it could be considered a vibration.
How to reproduce
Recreate the setup shown in
Replace all diamond blocks in the setup with glowstone so that the ice begins to melt:
/fill ~9 ~-4 ~9 ~-9 ~9 ~-9 minecraft:glowstone replace minecraft:diamond_block
❌ When the ice melts, the sculk sensor is not activated
Expected behavior
The sculk sensor would be activated when the ice (or snow) melted.
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
relates to 2
Attachments
Comments 19
Nah, this seems logical now as a block is physically changing. Also relates to MC-211235.
Can confirm in 22w18a. Here's a code analysis regarding this issue.
Code Analysis:
The following is based on a decompiled version of Minecraft 1.18.2 using MCP-Reborn.
net.minecraft.world.level.block.SnowLayerBlock.java
public class SnowLayerBlock extends Block {
...
public void randomTick(BlockState $bs, ServerLevel $sl, BlockPos $bp, Random $r) {
if ($sl.getBrightness(LightLayer.BLOCK, $bp) > 11) {
dropResources($bs, $sl, $bp);
$sl.removeBlock($bp, false);
}
}
...
net.minecraft.world.level.block.IceBlock.java
public class IceBlock extends HalfTransparentBlock {
...
protected void melt(BlockState $bs, Level $l, BlockPos $bp) {
if ($l.dimensionType().ultraWarm()) {
$l.removeBlock($bp, false);
} else {
$l.setBlockAndUpdate($bp, Blocks.WATER.defaultBlockState());
$l.neighborChanged($bp, Blocks.WATER, $bp);
}
}
...
If we look at the above classes, we can see that ice and snow melting simply aren't registered as game events as the gameEvent()
method is never called, thus not detecting these actions as vibrations.
Potential Fix:
Simply calling the gameEvent()
method where appropriate within this piece of code should resolve this problem. The "BLOCK_DESTROY" game event tag would be expected to be used here for both of these actions as ice/snow is removed from the world. The following line of code could be used in order to fix this:
$LEVEL.gameEvent($PLAYER, GameEvent.BLOCK_DESTROY, $BLOCKPOS);
Can confirm