I am having trouble finding a way to modify the final damage.
I can see the getter for final damage
getOriginalFinalDamage();
getFinalDamage();
But I am not seeing a way to modify this. I only see a way to modify the base damage.
I only see a way to modify
setBaseDamage(double baseDamage);
Set DamageModifierType before);
You can’t set the final damage like that.
The way the event works is that there is a base damage, then modifiers are applied to create the final damage.
You can either set the base damage, or add your own modifier to the event that gets applied when the final damage is calculated.
So to in a way set the final damage I would have to use the modifiers that deal with damage reduction. My goal here is to bypass all armour etc that reduce the base damage.
I’ve already thought of this for you!
I present addModifierAfter. What this method does is add a new DamageModifier and Function after the desired DamageModifierTypes, what you can essentially do is explicitly come in after all other modifiers and simply return the negated damage afterwards (since damage modifiers are an additive modification of the base damage).