correct way to fix mineclone2 player hunger

Post Reply
dweek
New member
Posts: 1
Joined: Thu May 06, 2021 17:41
In-game: dweek

correct way to fix mineclone2 player hunger

by dweek » Post

Hello.
Question ,this is good way to fix mcl2-player-hunger ?

I add one new variable at init.lua > mcl_hunger.EXHAUST_FLOW = 10 and made some changes:

Code: Select all

..
minetest.register_globalstep(function(dtime)
	main_timer = main_timer + dtime
	timer = timer + dtime
	if main_timer > mcl_hunger.HUD_TICK or timer > 0.5 then
		if main_timer > mcl_hunger.HUD_TICK then main_timer = 0 end
		for _,player in ipairs(minetest.get_connected_players()) do
		local name = player:get_player_name()
		
	-- litle exaust flow ,all time counting :) 
		mcl_hunger.exhaust(name, mcl_hunger.EXHAUST_FLOW)
	-- end of fix
	 
		local h = tonumber(mcl_hunger.get_hunger(player))
		local hp = player:get_hp()
		if timer > 0.5 then
			-- Slow health regeneration, and hunger damage (every 4s).
			-- Regeneration rate based on tutorial video 
..
and small fix to death way

Code: Select all

..
-- next fix - i cant die at starving, value hp stop at 1 value  
-- original: if hp-1 > 0 then  
if hp-1 >= 0 then
	if mod_death_messages then
	..
	end
	player:set_hp(hp-1)
end
..
if set mcl_hunger.EXHAUST_LVL = 2000 , have +- 8 minutes of starvation to death :D (1000 = 4 minutes,2000 = 8minutes ... 4000 = 16 minutes). when eat food have +3 minutes time before starvation. this litle fixs work good for me.

x2048
Developer
Posts: 68
Joined: Mon Feb 15, 2021 22:41
GitHub: x2048

Re: correct way to fix mineclone2 player hunger

by x2048 » Post

Hi dweek

First, since this is a game-specific question, a
better place for it would be in Game discussion forum.

To answer your question, it is great that you have changed the hunger mechanics to make game experience better. This is the whole point of Minetest to be easily customizable.

However I doubt these changes will be accepted into the game since MineClone2 aims to reproduce Minecraft game mechanics.

If you want more feedback, I'd recommend asking on Discord, you can find MineClone2 community on Disboard

Hope this helps.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Renaud, ROllerozxa and 11 guests