Sculk sensors are not activated upon snow being formed
The Bug:
Sculk sensors are not activated upon snow being formed.
Steps to Reproduce:
- Enter a cold biome and place down a sculk sensor nearby.
- Set to weather to "rain" to make it snow and wait for some snow to form.
- Take note as to whether or not sculk sensors are activated upon snow being formed.
Observed Behavior:
Sculk sensors aren't activated.
Expected Behavior:
Sculk sensors would be activated.
Code Analysis:
Code analysis by [Mod] Avoma can be found below.
The following is based on a decompiled version of Minecraft 1.18.2 using MCP-Reborn.
net.minecraft.server.level.ServerLevel.java
public class ServerLevel extends Level implements WorldGenLevel { ... public void tickChunk(LevelChunk p_8715_, int p_8716_) { ChunkPos chunkpos = p_8715_.getPos(); boolean flag = this.isRaining(); int i = chunkpos.getMinBlockX(); int j = chunkpos.getMinBlockZ(); ... if (this.random.nextInt(16) == 0) { BlockPos blockpos2 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, this.getBlockRandomPos(i, 0, j, 15)); ... Biome biome = this.getBiome(blockpos2).value(); ... if (flag) { if (biome.shouldSnow(this, blockpos2)) { this.setBlockAndUpdate(blockpos2, Blocks.SNOW.defaultBlockState()); } ...
If we look at the above class, we can see that snow forming as a result of precipitation simply isn't registered as a game event as the gameEvent() method is never called, thus not detecting this action as a vibration.
Potential Fix:
Simply calling the gameEvent() method where appropriate within this piece of code should resolve this problem. The "BLOCK_PLACE" game event tag would be expected to be used here as snow is being placed into the world.
2021-01-12, 03:53 PM
2024-12-08, 01:01 PM
7
4
-