The bug
When shooting a player with a bow with the flame enchantment and they block it with a shield, they take no damage but are still set on fire.
Code analysis
Code analysis by @unknown in this comment.
Linked issues
is duplicated by 8
relates to 2
Comments 8
Command to reproduce:
/summon skeleton ~ ~1 ~ {ArmorItems:[{},{},{},{id:"stone",Count:1b}],HandItems:[{id:"bow",Count:1b,tag:{ench:[{id:50s,lvl:1s}]}}]}
The following is based on a decompiled version of MC 1.12 using MC 9.40pre-1.
In the method net.minecraft.entity.projectile.EntityArrow.onHit()
the hit entity is set on fire if the arrow is burning without checking if the player is blocking with a shield.
if (this.isBurning() && !(entity instanceof EntityEnderman))
{
entity.setFire(5);
}
This can either be fixed by adding this specific check (net.minecraft.entity.projectile.EntityArrow.onHit()
) or by checking if the entity which hit the player while blocking is a burning arrow, and, of course, if the player wasn't burning before (net.minecraft.entity.EntityLivingBase.attackEntityFrom()
).
The contents of this bug should be updated to include Blaze fireballs, as this only became a bug in 1.13 (MC-136396) but was deemed a duplicate of this if correctly done so.
Confirmed for 16w06a