MC-264204 Fix
This server-side mod fixes a bug where death from a goat ramming is not tracked by advancements and statistics. The issue was reported in Mojang's bug tracker under number MC-264204.
Technical Details of the Fix
Damage dealt by goats is marked with a special NO_ANGER flag that hides the attacking entity from the attacked one. This prevents mobs from becoming aggressive in response to the attack. However, developers did not consider the scenario when the target is a player. Since players are not regular mobs, this flag should not apply to them.
The solution involves skipping the check for this flag when the attacked entity is a player. This allows the system to register the goat's attack, ensuring that advancement and statistics triggers work properly.
This issue has existed since goats were added to the game, but in Minecraft 1.20 the situation worsened after a code refactoring that removed the part that ensured relatively correct operation of the mechanism.