Started by
aoooodi2
on
Topic category: Help with Minecraft modding (Java Edition)
Im trying to make an armor that reduces certain type of damage taken by a percentage. I have tried multiple methods and haven't find a correct way to do it, is this possible?
While I haven't done this myself, I think this would work:
The resistance factor is the percentage of damage reduction (e.g. 10%) divided by 100. For example, 10% resistance would become 0.1, 80% resistance would become 0.8, etc. By first canceling the original damage, then scaling the damage by that factor, it will be as if the damage was reduced by that percentage. Then you simply have to damage the entity by that new damage value that was reduced in order for it to work.
Hope this works! :)