Closed demisys closed 1 year ago
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.
As of Data Attributes 1.3.0 for 1.18.2 and 1.4.0 for 1.19.2, multiply-type functions are now a feature. The implementation differs slightly to how you have proposed, but offers essentially the same functionality.
Documentation to come.
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 PlayereExstrength
attribute increasesmelee_damage
by 0.01, andmelee_damage
increasesgeneric.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
functions.json
Let me know if this is something that's good for the mod and if I should make a PR.