So I got it to work, though not the way I thought I would. A little hack I learned from the live streams:
entities/plants/berry_bush.json
:
"stonehearth:renewable_resource_node": {
"task_group_name" : "stonehearth:task_group:harvest",
"resource" : {
"stonehearth:food:berries:berry_basket" : "",
"stonehearth:resources:wood:oak_log" : ""
},
"renewal_time" : "22h",
"harvest_command" : "harvest_berries",
"unripe_description" : "Not yet ripe for harvest.",
"harvest_overlay_effect" : "/stonehearth/data/effects/harvest_plant_overlay_effect"
}
And then, in components/renewable_resource_node/renewable_resource_node_component.luac
, find the function spawn_resource
, and replace it with:
function RenewableResourceNodeComponent:spawn_resource(owner,location)
if self._resource then
local item
if type( self._resource ) == "table" then
for key, value in pairs(self._resource) do
item=radiant.entities.create_entity(key)
local pt=radiant.terrain.find_placement_point(location,0,2)
radiant.terrain.place_entity(item,pt)
stonehearth.inventory:get_inventory(owner):add_item(item)
end
else
item=radiant.entities.create_entity(self._resource)
local pt=radiant.terrain.find_placement_point(location,0,2)
radiant.terrain.place_entity(item,pt)
stonehearth.inventory:get_inventory(owner):add_item(item)
end
local render_info=self._entity:add_component('render_info')
render_info:set_model_variant('depleted')
self:_start_renew_timer(self._renewal_time)
if self._unripe_description then
self._entity:get_component('unit_info'):set_description(self._unripe_description)
end
if self._renew_effect_name then
end
self._sv.harvestable=false
self.__saved_variables:mark_changed()
return item
end
end
Short explanation:
- For some reason, Stonehearth doesn’t like reading array values (@RepeatPan, any clue why?)
- We substitute the array with a table, in which we will only use the keys (the values are left blank,
""
).
- In the Lua code, we first check whether the node only has one resource, or a bunch (i.e. we check the type of the
self._resource
variable for whether it’s a table or a string).
- If there are multiple components, drop them.
- If there is just one component, drop it.
I’ve tested this, and it works with both the modified berry bush and unmodified resources, thanks to us checking the type of the resource before dropping it. Now the hard part, packaging all this into an smod
, I’ll leave to you 
EDIT: Be careful, the function spawn_resource
returns an item
when it completes. If there’s only one resource being dropped, that’s fine. If there’s more than one, only the last item dropped gets returned. I don’t know how this can/will affect the game right now, but it’s something to keep in mind.