1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2025-06-29 14:50:52 +02:00

add {eatable} group to default apple, blueberries, mushrooms if found

This commit is contained in:
tenplus1
2024-07-26 15:29:09 +01:00
parent e2ec7d707e
commit 648bae7517
2 changed files with 25 additions and 1 deletions

View File

@ -8,6 +8,30 @@ local alias = function(orig, new)
minetest.register_alias(orig, new)
end
--= Add {eatable} group to default apple, blueberries and brown mushroom
local function add_grp(item, hp)
local def = minetest.registered_items[item]
if def then
def.groups.eatable = hp
def.description = def.description .. " (♥" .. hp .. ")"
minetest.override_item(item, {
description = def.description,
groups = def.groups
})
end
end
add_grp("default:apple", 2)
add_grp("default:blueberries", 1)
add_grp("flowers:mushroom_brown", 1)
add_grp("flowers:mushroom_red", -5)
--= Aliases
-- Banana