-minetest.register_abm({
- nodenames = {"xdecor:hive"},
- interval = 10, chance = 5,
- action = function(pos, _, _, _)
- local inv = minetest.get_meta(pos):get_inventory()
- local honeystack = inv:get_stack("honey", 1)
- local honey = honeystack:get_count()
-
- local radius = 8
- local minp = vector.add(pos, -radius)
- local maxp = vector.add(pos, radius)
- local flowers = minetest.find_nodes_in_area(minp, maxp, "group:flower")
-
- if #flowers >= 4 and honey < 16 then
- inv:add_item("honey", "xdecor:honey") end
- end
-})