mojira.dev
MC-210117

Sculk sensors don't detect ice/snow melting

The bug

When ice/snow melts, sculk sensors nearby don't detect this, although it could be considered a vibration.

How to reproduce

  1. Recreate the setup shown in

[media]
  1. 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

Attachments

Comments 19

Can confirm however, I'd definitely consider this as a feature request. See MC-207278 and MC-207276.

The sculk sensor also doesn't detect snow layers melting as well.

Avoma I don't see any type of connection between this and MC-207278 or MC-207276. This report is about ice breaking, not plants growing.

Nah, this seems logical now as a block is physically changing. Also relates to MC-211235.

9 more comments

Can confirm in 1.18.1.

can confirm in 22w07a

Can confirm in 1.18.2.

Can confirm in 22w14a.

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);

violine1101

(Unassigned)

Confirmed

Gameplay

Low

Game Events

20w51a, 21w03a, 21w05b, 21w06a, 21w07a, ..., 1.19, 1.19.4, 23w17a, 1.20.1, 1.21.4

Retrieved