* you regularly get hungry
* when you feel hunger it hurts
* the less health you have the faster you get hungry
* no hunger bar
* when doing nothing (afk) nothing happens, you won't die
Download in the attachment.
License: GPLv3 or later
==Old Version==
This adds hunger to minetest.
There is no bar that shows you how hungry you are. Instead the program counts and after a day without eating your stomach is rebelling (you will get hurt, hear a sound and get a message). Half the time later it happens again. Half of half the time again. It gets faster and faster until you starve to death.
When eating something the counter is not set to zero, but to its half.
You can get a "Hunger-meter" by using "/giveme hunger:hunger_meter"
Installing:
Now, just like any other mod.
Download (old!):
http://ompldr.org/vZ3Zsag/hunger%2020121229.zip <--- latest
Older versions (for installation see posts below):
http://ompldr.org/vZ3R2cw/hunger%2020121226.zip
http://ompldr.org/vZmttZA/hunger%2020120921.zip
License: CC BY-SA
No dependencies on non-default mods.
==original post==
I want to make a mod that adds hunger to the game. Mainly based on drowning. I'm happy for everyone who wants to work on this project.
The goal is a bugfree mod that can be added to the default game. So you can make a survival-gamemode.
At the moment I'm searching for a method to check if a player eats something. The only thing I found so far is in the item-definition.
- Code: Select all
minetest.item_eat(hp_change, replace_with_item)
You would have to overwrite all eatable items. But there are a lot mods out there that add eatable stuff, so it would be better to have something independently working.
Best thing would be
- Code: Select all
minetest.register_on_eat (func(player, item))
Is there a possibility to ad a minetest.register* in Lua or is it only possible in C++?