Topic category: Help with Minecraft modding (Java Edition)
Okay, so for my mod, I'm adding attributes. One of the attributes is Defense. No, it doesn't just upgrade a player's Max Health because I already have an attribute for that, but I want it to get/determine the damage that a mob or player would do to you in advance and subtract however many points of Defense you have off of the attack. Why would I need this, you ask? Well, in the mod, I've figured out how to make the player's health go above the standard 20 without effects, but the health cap is 1,024, and the Strength/Damage cap is much higher. Say you had 1,024 health, and an opponent (a player) had 500 or + Strength, that means you would get two or three shotted. So that's where defense comes into play, subtracting a certain amount of damage from the player's attack.
What I need to know is, with procedures or code, how would I decide how much damage that another player on Multiplayer, or even a mob would do before they attack you? And if it doesn't exist, can we get this feature? Cuz' that would be amazing!
Anyone? Thank you.