Buffs and attribute influence


Hello there,
I try to get a list about all the attributes which can be referred to by buff.
First of all:
What modifiers are possible ?
I know: add and multiply
Is subtract and divide possible or is the solution
"Add": negative value and multiply by 0.x ?

What attributes or stats are directly accessible ?
I know:
9 attributes, health, sleepiness
Is something like:
Attack speed, happiness, grow time, cooldown for shields, block chance, backpack size
Possible ?
Or can someone point me to the function which handles all this ?


Hi Chabonit,

Right now multipliers can only add, multiply, or set a min / max. You can access any attribute that a hearthling has using radiant.entities.get_attribute(entity, attribute_name). Most of the attributes that can be modified for hearthlings are listed under stonehearth:attributes in the base_human.json file.

Most methods are in attributes_component.lua. modify_attribute applies modifiers on an attribute and set/get_attribute are the setter and getter for attributes.


I must bump this to get abetter understanding for limitations of modding.
Is it possible to change the attributes of a weapon or is rhat not possible because its a component ?

I would love to change values of all entities with buffs. Would be nice to see a necromancer walking through town and all lights turn green.
No thats off the scale i know but buffing components like grow time, weapon dmg, shield cooldowns etc would be very nice

What about fine percentage changes with a buff ?

Maybe even change recipe components (ingredients) crafting time…


Unfortunately, we don’t have a system that would allow you to easily make the above changes . Some of the examples you mentioned (changing a weapon’s base damage or cooldowns, changing a particular item’s fine crafting percentage or an ingredient’s crafting time) touch completely different systems that each have a different way they get their values. Most of these look at different json files for their data, so you would go to where ever these systems get their values and modify that to look at a buff or attribute value on the entity instead.

Attributes / buffs wouldn’t work for recipes though, since a recipe is just a json representation and not an actual entity.