mojira.dev
MC-265045

Entities cannot be extinguished by rain when inside a position with a non-full block.

The Bug

When an entity is (either partially or completely) next to, or inside a non-full block, it will not be able to be extinguished by rainfall.

Steps to Reproduce:

(Issue is reproduced as a survival mode player, but issue applies to all entities)

  1. Set weather to rainy, and apply regeneration (for ease of reproduction)

    1. /weather rain
    2. /effect give @a minecraft:regeneration infinite 20
  2.  Locate a desert biome

    /locate biome minecraft:desert
  3. Replicate this setup on the border of the desert biome, and a rainy biome:

    [media]
  4. Stand in the fire long enough to be lit on fire

  5. Walk into the open trapdoors

Observed Results:

The entity (a player in this case) will continue to be on fire despite having sky access to rain.

Expected Results:

The entity that is on fire would be extinguished properly as they are not blocked by the rain falling.

Screenshots/Videos:

[media]

Code Analysis (MCP):

This is because of the isRainingAt() method in Level.java (net.minecraft.world.level).
Specifically, the block position is checked to see if the hightmap type is "MOTION_BLOCKING".

public boolean isRainingAt(BlockPos blockPos) {
      if (!this.isRaining()) {
         return false;
      } else if (!this.canSeeSky(blockPos)) {
         return false;
      } else if (this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, blockPos).getY() > blockPos.getY()) {
         return false;
      } else {
         Biome biome = this.getBiome(blockPos).value();
         return biome.getPrecipitationAt(blockPos) == Biome.Precipitation.RAIN;
      }
   }

(For demonstration only) After removing the getHeightmapPos() check, the player is properly extinguished as expected:

[media]

Notes:
Relates to MC-211475, MC-265046, MC-265047, MC-265048 and MC-265049

Linked issues

Attachments

Comments 0

No comments.

[Mod] Jingy

(Unassigned)

Confirmed

Entities

1.20.1, 23w33a, 23w35a

Retrieved