Players have to have 3 full hunger drumsticks to run, automatically stops them if goes too low

This commit is contained in:
oilboi 2020-05-05 21:07:57 -04:00
parent 78dbab8511
commit 8f617c5e72

View File

@ -18,6 +18,8 @@ minetest.register_globalstep(function(dtime)
for _,player in ipairs(minetest.get_connected_players()) do
local meta = player:get_meta()
local hunger = meta:get_int("hunger")
local running = (meta:get_string("player.player_movement_state") == "1")
local bunny_hopping = (meta:get_string("player.player_movement_state") == "2")
local sneaking = (meta:get_string("player.player_movement_state") == "3")
@ -26,7 +28,7 @@ minetest.register_globalstep(function(dtime)
--running FOV modifier
if running or bunny_hopping then
if hunger > 6 and (running or bunny_hopping) then
if bunny_hopping == true then
player:set_fov(1.4, true,0.1)
player:set_physics_override({speed=1.75})