summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-09-29 20:06:02 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2018-09-29 20:06:02 +0100
commit0108b98e82690d104d7e2b15786ba1c611c9e12b (patch)
tree4514a2e4891ae26c18391c196fb4b2ad5ba91977
parent43d62b57428b4738a7e8cee0fae78b1147f9b085 (diff)
golden apples heal hp even when using hunger mods
-rw-r--r--food.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/food.lua b/food.lua
index 156e97f..390f2cd 100644
--- a/food.lua
+++ b/food.lua
@@ -144,7 +144,13 @@ minetest.register_node("ethereal:golden_apple", {
leafdecay = 3,leafdecay_drop = 1
},
drop = "ethereal:golden_apple",
- on_use = minetest.item_eat(20),
+-- on_use = minetest.item_eat(20),
+ on_use = function(itemstack, user, pointed_thing)
+ if user then
+ user:set_hp(20)
+ return minetest.do_item_eat(2, nil, itemstack, user, pointed_thing)
+ end
+ end,
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer, itemstack)
if placer:is_player() then