[1.16.3] Ancient Wills not working
nvclas opened this issue ยท 2 comments
Version Information
Forge version: 1.16.3-forge-34.1.35
Botania version: Botania-1.16.3-409
Further Information
Steps to reproduce:
- Craft Terrasteel Armor
- Apply any ancient will
- Critically hit a mob
- No effect
What I expected to happen:
For example when using the Will of Karil usually the mob I hit will get a Wither II effect
What happened instead:
Nothing
This seems to be an issue indicated by a comment in the code stating that the critical check won't work: part of the check is to see if the attack cooldown is greater than a certain amount, but the code runs AFTER the cooldown is set to zero. The code comment suggests a mixin but...
I have a possible fix to suggest @williewillus. Instead of checking the attack cooldown, why not try checking the damage the weapon delt vs the weapon's base damage? If it's set to 150% base damage at that point, you could use that to check for a critical (I'd recommend keeping the other checks just in case, though). If it isn't set to 150% base damage at that point for whatever reason, you could probably invert the damage formula to get what the cooldown was when the damage was dealt. (I'm not sure if it's always set to 150% base damage regardless of cooldown or not, don't have the source on me atm).
I'd help directly, but I'm not the most familiar with current minecraft modding, and don't have a proper setup, but I feel like this would work.
that's a decent idea in concept, but it adds maintenance overhead, since you're depending on a side-effect of the critical hit code rather than the critical hit check itself (so e.g. if for some reason, some other mod mixins and changes the crit damage value, we get weird breaking)