mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-25 04:13:44 +01:00
you no longer can get potion effects without eating the stew
This commit is contained in:
parent
da12a0a5b2
commit
a4c608aada
16
init.lua
16
init.lua
@ -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)
|
local function poison(itemstack, placer, pointed_thing)
|
||||||
|
local hunger = mcl_hunger.get_hunger(placer)
|
||||||
|
if hunger < 20 then
|
||||||
mcl_potions.poison_func(placer, 1, 12)
|
mcl_potions.poison_func(placer, 1, 12)
|
||||||
return eat(itemstack, placer, pointed_thing)
|
return eat(itemstack, placer, pointed_thing)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function hunger(itemstack, placer, pointed_thing, player)
|
local function hunger(itemstack, placer, pointed_thing, player)
|
||||||
|
local hunger = mcl_hunger.get_hunger(placer)
|
||||||
|
if hunger < 20 then
|
||||||
return eat(itemstack, placer, pointed_thing)
|
return eat(itemstack, placer, pointed_thing)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function jump_boost(itemstack, placer, pointed_thing)
|
local function jump_boost(itemstack, placer, pointed_thing)
|
||||||
|
local hunger = mcl_hunger.get_hunger(placer)
|
||||||
|
if hunger < 20 then
|
||||||
mcl_potions.leaping_func(placer, 1, 6)
|
mcl_potions.leaping_func(placer, 1, 6)
|
||||||
return eat(itemstack, placer, pointed_thing)
|
return eat(itemstack, placer, pointed_thing)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function regeneration(itemstack, placer, pointed_thing)
|
local function regeneration(itemstack, placer, pointed_thing)
|
||||||
|
local hunger = mcl_hunger.get_hunger(placer)
|
||||||
|
if hunger < 20 then
|
||||||
mcl_potions.regeneration_func(placer, 1, 8)
|
mcl_potions.regeneration_func(placer, 1, 8)
|
||||||
return eat(itemstack, placer, pointed_thing)
|
return eat(itemstack, placer, pointed_thing)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function night_vision(itemstack, placer, pointed_thing)
|
local function night_vision(itemstack, placer, pointed_thing)
|
||||||
|
local hunger = mcl_hunger.get_hunger(placer)
|
||||||
|
if hunger < 20 then
|
||||||
mcl_potions.night_vision_func(placer, 1, 5)
|
mcl_potions.night_vision_func(placer, 1, 5)
|
||||||
return eat(itemstack, placer, pointed_thing)
|
return eat(itemstack, placer, pointed_thing)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- ________________________
|
-- ________________________
|
||||||
--_________________________________________/ Item Regestration \_________________
|
--_________________________________________/ Item Regestration \_________________
|
||||||
minetest.register_craftitem("mcl_sus_stew:poison_stew",{
|
minetest.register_craftitem("mcl_sus_stew:poison_stew",{
|
||||||
|
Loading…
Reference in New Issue
Block a user