ClientPlayerEntity.damage() is often called even when the player's health isn't actually going to change. For example, fire damage while under the effect of Fire Resistance.
Instead, let's check LivingEntity.setHealth(), since this is where actual changes to the player's health are made.
disableOnDamage will still activate when damaged while health is regenerating on average. But to fix that we'd have to track health over time and only disable when we detect a lasting reduction in health... Not in the scope of this simple PR.
ClientPlayerEntity.damage()
is often called even when the player's health isn't actually going to change. For example, fire damage while under the effect of Fire Resistance.Instead, let's check
LivingEntity.setHealth()
, since this is where actual changes to the player's health are made.disableOnDamage will still activate when damaged while health is regenerating on average. But to fix that we'd have to track health over time and only disable when we detect a lasting reduction in health... Not in the scope of this simple PR.
Fixes #63