Started by
Zanxuz
on
Topic category: Help with Minecraft modding (Java Edition)
Hello I want to make a food mod but I want to detect the hunger value of the food automatically in a block, something like "get the food value of apple", but i don't know how, you can even?
Something like variable will help you.
What do you mean, detect it then what?
Hunger? Healed? or what?
i mean how to get the amount of hunger what a food restores when is eaten, but i want to get with a procedure or in code because i want to get the value even of other mod without need of add recipes for compability, something like "this food restores 5 point of hunger so the machine will return 5 items"
Oh, please wait.
Go to your food element, go to properties
Do you see nutritional value?
If you change it to 1, it's 1/2 of hunger bar
If you change it to 2, it's 1 hunger bar
If you change it to 4, it's 4 hunger bar
If you change it to 20, it's full
Hope this help :)