[Request] Multiply based Attribute Functions
demisys opened this issue ยท 2 comments
Not sure if there's a better way to do this in the mod already, but I made a fork for my personal use with PlayerEx to re-balance attack damage and attack speed gain when levelling strength/dexterity.
https://github.com/demisys/Data-Attributes/tree/multiply.function
I added FunctionBehaviour to attributes that determines if it's added to other attributes (as it currently does) with ADD,
or multiples the attribute (for example +1% attack damage per strength level instead of +0.25 attack damage per strength level) with MULTIPLY.
The way I got it working is by making an intermediate melee_damage attribute that has "functionBehaviour": "MULTIPLY" defined. Then the PlayereEx strength attribute increases melee_damage by 0.01, and melee_damage increases generic.attack_damage by 1.0. I did a similar thing with attack_speed.
With my custom datapack and .jar build, level 50 strength will give +50% melee damage applied after Sharpness/Strength/RelicEx bonuses, instead of adding on a flat +12.5 attack damage. I'm still testing out the exact % gain per level for good balance, but so far it makes slow and high damage weapons not fall behind as much in dps compared to fast weapons.
data/playerex/attributes/overrides/melee_damage.json
{
"fallbackValue": 0.0,
"minValue": -10.0,
"maxValue": 10.0,
"incrementValue": 0.01,
"translationKey": "attribute.name.generic.attack_damage",
"stackingBehaviour": "FLAT",
"functionBehaviour": "MULTIPLY"
}functions.json
"playerex:strength": {
"playerex:melee_damage": 0.01,
"minecraft:generic.armor": 0.5,
"playerex:health_regeneration": 0.01
},
"playerex:melee_damage": {
"minecraft:generic.attack_damage": 1.0
},Let me know if this is something that's good for the mod and if I should make a PR.
Hi there,
I just wanted to let you know that I have read this, and I'm putting a pin here for later but I will come back to it. I've been thinking about your post for a few days now and would like to consider what you have written for a bit longer before taking any action.
Thanks.