mojira.dev
MC-106291

Snow golem leaves snow trail while dying

The bug

When you kill a snow golem with a bow, it will leave a trail of snow when he dies (video).

How to reproduce

  1. Give yourself a bow with punch II, and summon a snow golem.

    /give @s bow{Enchantments:[{id:unbreaking,lvl:3},{id:punch,lvl:2}]}
    /summon minecraft:snow_golem
  2. Shoot the snow golem.
    → ✔ Snow golem dies as expected
    → ❌ but it left a snow trail behind while in it's death animation

Code analysis

Based on 1.12.2 names.

This could be fixed by adding this.isEntityAlive() boolean-method in the method net.minecraft.entity.monster.EntitySnowman.onLivingUpdate() by the if-statment where it checks for the biome temperature, ect.

for (int l = 0; l < 4; ++l)
            {
                i = MathHelper.floor(this.posX + (double)((float)(l % 2 * 2 - 1) * 0.25F));
                j = MathHelper.floor(this.posY);
                k = MathHelper.floor(this.posZ + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F));
                BlockPos blockpos = new BlockPos(i, j, k);
                //Added isEntityAlive() boolean-method here
                if (this.isEntityAlive() && this.world.getBlockState(blockpos).getMaterial() == Material.AIR && this.world.getBiome(blockpos).getTemperature(blockpos) < 0.8F && Blocks.SNOW_LAYER.canPlaceBlockAt(this.world, blockpos))
                {
                    this.world.setBlockState(blockpos, Blocks.SNOW_LAYER.getDefaultState());
                }
            }

Related issues

Comments

migrated

It makes perfect sense that a SNOW golem would create SNOW when it dies. Think about that situation in real life. If you had a living snowman walking around, and you killed it, do you think the snow that it's made out of would just magically disappear?

migrated

Snow golems create snow layers on a daily basis, so it could either work as intended beause the snow golem is still there and should still produce more snow, or it could be bug because the snow golem is dead and therefore should no longer function and produce new snow. There's also the possibility I have long, yet gramatically correct sentences.

migrated

Chatted with Cory about this and we liked it's behavior, even if it's slight different then other mobs behaviors when dying

migrated

migrated

Confirmed

Minecraft 1.10.2, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.13.1, Minecraft 1.13.2, ..., Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w05a, Minecraft 19w06a, Minecraft 19w07a

Retrieved