Topic category: Help with modding (Java Edition)
I'm trying to get a sword I'm working on to deal extra damage when the target's health is full - i.e Sword usually does 9 damage, but if the target is at 20/20hp it does 14 damage.
So far I've tried the following procedure :
if Target entity health = Target entity max health
do  damage to Target entity of type GENERIC
with no result, Sword does its base damage regardless of the enemy's HP. I'm assuming that's because at the time of the attack, the entity technically doesn't have its maximum health any more, so the effect doesn't apply? I'm not sure what I could change here, if anyone has any insight on this, I'd appreciate it.