From acea309564fa9bd206f3635212779ed953646194 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sat, 1 Aug 2020 08:36:22 -0400 Subject: [PATCH] Add poison effect for pufferfish, remove mcl_hunger control for pufferfish effect --- mods/ITEMS/mcl_fishing/init.lua | 14 +++++++++++--- mods/PLAYER/mcl_hunger/register_foods.lua | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_fishing/init.lua b/mods/ITEMS/mcl_fishing/init.lua index 365dec0d2a..b705d318fa 100644 --- a/mods/ITEMS/mcl_fishing/init.lua +++ b/mods/ITEMS/mcl_fishing/init.lua @@ -417,8 +417,7 @@ minetest.register_craftitem("mcl_fishing:clownfish_raw", { _mcl_saturation = 0.2, }) --- Pufferfish --- TODO: Add real status effect + minetest.register_craftitem("mcl_fishing:pufferfish_raw", { description = S("Pufferfish"), _tt_help = minetest.colorize("#FFFF00", S("Very poisonous")), @@ -428,5 +427,14 @@ minetest.register_craftitem("mcl_fishing:pufferfish_raw", { on_secondary_use = minetest.item_eat(1), stack_max = 64, groups = { food=2, eatable=1, brewitem = 1 }, - _mcl_saturation = 0.2, + -- _mcl_saturation = 0.2, }) + + +minetest.register_on_item_eat(function (hp_change, replace_with_item, itemstack, user, pointed_thing) + + if itemstack:get_name() == "mcl_fishing:pufferfish_raw" then + mcl_potions.poison_func(user, 1.25, 7) + end + +end ) diff --git a/mods/PLAYER/mcl_hunger/register_foods.lua b/mods/PLAYER/mcl_hunger/register_foods.lua index 449c1c4fe8..d4c933169d 100644 --- a/mods/PLAYER/mcl_hunger/register_foods.lua +++ b/mods/PLAYER/mcl_hunger/register_foods.lua @@ -8,4 +8,4 @@ mcl_hunger.register_food("mcl_mobitems:rotten_flesh", 4, "", 30, 0, 100, 80) mcl_hunger.register_food("mcl_mobitems:chicken", 2, "", 30, 0, 100, 30) mcl_hunger.register_food("mcl_mobitems:spider_eye", 2, "", 4, 1, 0) -mcl_hunger.register_food("mcl_fishing:pufferfish_raw", 1, "", 60, 1, 300) +-- mcl_hunger.register_food("mcl_fishing:pufferfish_raw", 1, "", 60, 1, 300)