The bug
When you hit an invulnerable guardian in survival, you will still get the thorns damage, even though you didn't even deal damage to it. Punching an invulnerable mob with armor enchanted with thorns won't do that.
How to reproduce
Summon an invulnerable guardian
/summon guardian ~ ~ ~ {Invulnerable:1b,NoAI:1b}
Switch to Survival mode
/gamemode survival
Punch it
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.entity.monster.EntityGuardian.attackEntityFrom(DamageSource, float)
attacks the damaging entity regardless of if the parent method successfully dealt damage.
Attachments
Comments 18
Ticket resolved as incomplete, because no answer in a reasonable amount of time (1+ year), if it still happens, please update the ticket.
Does this issue still occur in snapshot 15w36d?