1
0
Fork 0

you no longer can get potion effects without eating the stew

This commit is contained in:
chmodsayshello 2022-01-01 08:19:01 +00:00
parent da12a0a5b2
commit a4c608aada
1 changed files with 25 additions and 9 deletions

View File

@ -7,29 +7,45 @@ local eat = minetest.item_eat(6, "mcl_core:bowl") --6 hunger points, player rece
local function poison(itemstack, placer, pointed_thing)
mcl_potions.poison_func(placer, 1, 12)
return eat(itemstack, placer, pointed_thing)
local hunger = mcl_hunger.get_hunger(placer)
if hunger < 20 then
mcl_potions.poison_func(placer, 1, 12)
return eat(itemstack, placer, pointed_thing)
end
end
local function hunger(itemstack, placer, pointed_thing, player)
return eat(itemstack, placer, pointed_thing)
local hunger = mcl_hunger.get_hunger(placer)
if hunger < 20 then
return eat(itemstack, placer, pointed_thing)
end
end
local function jump_boost(itemstack, placer, pointed_thing)
mcl_potions.leaping_func(placer, 1, 6)
return eat(itemstack, placer, pointed_thing)
local hunger = mcl_hunger.get_hunger(placer)
if hunger < 20 then
mcl_potions.leaping_func(placer, 1, 6)
return eat(itemstack, placer, pointed_thing)
end
end
local function regeneration(itemstack, placer, pointed_thing)
mcl_potions.regeneration_func(placer, 1, 8)
return eat(itemstack, placer, pointed_thing)
local hunger = mcl_hunger.get_hunger(placer)
if hunger < 20 then
mcl_potions.regeneration_func(placer, 1, 8)
return eat(itemstack, placer, pointed_thing)
end
end
local function night_vision(itemstack, placer, pointed_thing)
mcl_potions.night_vision_func(placer, 1, 5)
return eat(itemstack, placer, pointed_thing)
local hunger = mcl_hunger.get_hunger(placer)
if hunger < 20 then
mcl_potions.night_vision_func(placer, 1, 5)
return eat(itemstack, placer, pointed_thing)
end
end
-- ________________________
--_________________________________________/ Item Regestration \_________________
minetest.register_craftitem("mcl_sus_stew:poison_stew",{