add helper function to add {eatable}

This commit is contained in:
tenplus1
2024-07-26 16:30:53 +01:00
parent 648bae7517
commit 75e3f9fb42
41 changed files with 387 additions and 205 deletions

View File

@ -8,10 +8,10 @@ local S = farming.translate
-- cucumber
minetest.register_craftitem("farming:cucumber", {
description = S("Cucumber") .. " (♥4)",
description = S("Cucumber"),
inventory_image = "farming_cucumber.png",
groups = {
compostability = 48, seed = 2, food_cucumber = 1, flammable = 2, eatable = 4
compostability = 48, seed = 2, food_cucumber = 1, flammable = 2
},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1")
@ -19,6 +19,8 @@ minetest.register_craftitem("farming:cucumber", {
on_use = minetest.item_eat(4)
})
farming.add_eatable("farming:cucumber", 4)
-- cucumber definition
local def = {
drawtype = "plantlike",