Mojira Archive
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());
                }
            }