Need help adding buffs

Attempted to add buffs to food but won’t work.

What am I doing wrong?

   "mixins": "stonehearth:mixins:item_properties",
   "type": "entity",
   "components": {
      "model_variants": {
         "default": {
            "models": [
   "entity_data": {
      "stonehearth:item": {
         "category": "food",
         "destroy_on_uncarry": true
      "stonehearth:food": {
         "stonehearth:sitting_on_chair": {
            "satisfaction": 44
         "default": {
            "satisfaction": 40
         "buff": "stonehearth:buffs:fried_eggs",
         "quality": 5
      "stonehearth:catalog": {
         "display_name": "i18n(",
         "description": "i18n(",
         "material_tags": "food fried_eggs_serving vegetarian",
         "subject_override": "stonehearth:food:fried_eggs"
   "type": "buff",
   "axis": "buff",
   "display_name": "i18n(cookmod:data.buffs.fried_egg.fried_egg.display_name)",
   "description": "i18n(cookmod:data.buffs.fried_egg.fried_egg.description)",
   "icon": "file(fried_eggs.png)",
   "duration": "12h",
   "repeat_add_action": "renew_duration",
   "effect": "stonehearth:effects:buff_tonic_energy_added",
   "modifiers": {
      "speed": {
         "add": 10
      "health": {
         "add": 5
      "diligence": {
         "add": 5

I think other mods have already tried to do this, maybe look at
Food Buff Observer created by @RepeatPan he would probably know as he is referenced as helping a lot in these kinds of mods

I would dare say I didn’t just try, but actually succeeded in that. I’m not uptodate, so this might be outdated info.

For a “simple” implementation, check out Frostfeast, especially frostfeast/ai/observers/food_buff_observer.lua. Basic idea is to have an observer hooked to the eat event, then add some entity-data to each food that depicts which buff to add. Add the observer to the hearthling, and watch the thing go. Unless SH ships now with an observer, you’ll need to add one yourself. Keep in mind that this might conflict with other mods (e.g. if you’re using Frostfeast’s observer, then when using Frostfeast, the Cook Mod and your mod, the buff could be added three times/do weird stuff, although I think buffs are kind of singleton-ish in SH?).

1 Like

Thanks guys, I am actually looking at Cafe mod. I liked it but I didn’t like the thirst and the abundant food types.
I also just saw the observer thingy lol. I am not good at this at all.

Edit: I got the buff to work through potions but can’t get it to work through eating lol. (Tested through potions just to make sure the buff worked. Prob something with the Observer.

Courtesy of [MOD] Stonehearth Cafe (Cooking And Farming Expansion) 1.92


local FoodBuffObserver = class()

–Called first every time
function FoodBuffObserver:initialize()
– list all the saved variables
self._sv.entity = nil

–Called once on creation
function FoodBuffObserver:create(entity)
self._sv.entity = entity

–Always called. If restore, called after restore.
function FoodBuffObserver:activate()
–Wait for eat event.
self._entity = self._sv.entity
self._eat_listener =, ‘stonehearth:eat_food’, self, self._on_eat)

function FoodBuffObserver:_on_eat(e)
– Check the food’s entity data
local food_data = radiant.entities.get_entity_data(e.food_uri, ‘stonehearth:food’)
if not food_data then

-- Check if there's a buff attached to it
local food_buff = food_data.buff_uri

-- If it is, give it to the worker
if food_buff then
	radiant.entities.add_buff(self._entity, food_buff)


function FoodBuffObserver:destroy()
if self._eat_listener then
self._eat_listener = nil

return FoodBuffObserver

1 Like

Woooo I finally got it! Lmao. You modders are dope being able to create whole new classes, maps and even storylines…

Took me forever to mod a single item! HAHA!

1 Like

Hi, me again, now, I am trying to add a simple item, but Stonehearth doesn’t see the mod. When the game loads, i can’t change or edit the names of other mod files, but I can change mines meaning Stonehearth doesn’t see it. Any clue?

I don’t understand what you mean.
Place your mod in your mods-folder (Steam/steamapps/common/Stonehearth/mods); typically, as an .smod-file.

Do you see your mod within the settings of Stonehearth or not?
(sometimes Stonehearth can complain on “bad manifest” or similar)

Thanks for the reply and help Hamnisu, but, where would that be under settings? I don’t see anything about mods.

Never mind I see it. I think I am not creating the smod file correctly. I zip the folder and rename it “.smod”. I don’t think that is how it is supposed to be done lol.

Edit: LMAO, found a file called, Stonehearth.log… completely told me what was wrong. Modding is better with errors logs. :sweat_smile:

1 Like

Glad to hear that you found what was causing your issues :slight_smile:

1 Like