Armor & damage scaling[Forge/Fabric]

Armor & damage scaling[Forge/Fabric]

977k Downloads

[Help/Feature Request]

PixelatedBruh opened this issue · 5 comments

commented

Hi I am trying to do this
{
"armorFormula": {
"desc:": "Armor damage reduction formula, damage is multiplied by the value returned.Input value: armor Default:15/(armor+15)",
"armorFormula": "(damage * armor / (2 * armor)) / damage"

The game crashes when using "damage" as a value in the formula. Without this as a value I can use, I do not know how to make a formula that lets me get the desired results I want. 😭

commented

mod version 2.1 for fabric
minecraft version 1.19.2

crash-2023-04-28_07.44.52-server.txt

to help explain what i was trying to do. I am trying to make every armor point reduce incoming damage by half the amount as long as it is the same value as the armor. example

5 incoming damage against 5 armor points resulting in 2.5 damage received.

or 27 damage against 27 armor doing a total of 13.5

and further more if and attack does 20 damage but the armor value is higher like 40.
it would do only 1/4 the damage (5 damage)

commented

which mod version is this? crash logs?

commented

well if you read the config desc you'd notice that you only got armor as input parameter for the formula :D Update to version 2.5

commented

if you see this quick question. what are all the operators I can use? I am having an issue of having less armor than the damage source multiplying the damage above the original.

I guess what I need is a check for if the damage value is higher than the armor value it either ignores the armor or uses a different formula

commented

update I have got my intended result with this formula.

"MIN(damage,((damage * (1.5 / armor)) * damage))"

thank you for the amazing mod