Closed Madis0 closed 3 years ago
Made a mixin to foodTickTimer (foodStarvationTimer on Fabric mappings), returns just zero... Perhaps it is server-side?
Exhaustion is server-side, so this probably is too (hence protected int and all) 😢
Added an arrow to show when regen is happening, despite not knowing exact value
Although maybe saturation could be shown as the regen value?
Formula to approximate foodTickTimer behaviour:
naturalRegenerationHealth = 0;
if(health < maxHealth && hunger < 3 ){
int regenerationAddition = 0;
// Approximate formula for calculating regeneration addition health: saturation * exhaustion max / 6 exhaustion per healed heart
regenerationAddition = MathHelper.ceil((float)saturation * (float)4 / (float)6);
naturalRegenerationHealth = Math.min(health + regenerationAddition, maxHealth);
}
It works the first time hunger is in the correct value, but it shouldn't re-estimate until the health has that value... Or I guess the formula is just wrong.
https://minecraft.gamepedia.com/Hunger#Mechanics
Should be colored the same as saturation effect by default (or maybe light brown?)