Topic category: Help with modding (Java Edition)
I recently added a new food item and noticed it behaved as a super food. I'd heal almost a full health bar with an item that should be on par with an apple. After much probing around, I eventually came to suspect that the Saturation value was off. I whipped up a procedure to display Saturation and confirmed my suspicion. All my modded food items were pumping out massive Saturation.
It turns out that the value entered for the item's Saturation is not the value that appears in game. The actual value is equal to (2 x Food value x Saturation). So if you want a particular Saturation value in game you need to figure out what you want its Saturation Ratio to be and halve that value and use that on your food item.
If you wanted to make a clone of an Apple (Food 4 , Sat 2.4) and entered those values, in game you'd get a Saturation of 19.2, better than Steak!
To get the correct value, you'd need to enter (Food 4, Sat 0.3).
Is this an issue with the recent updates (I'm running the 1.18 snapshot) or has this always been like this? I didn't notice it the last time I worked on my mods (16.5) but upon reflection, I think my custom foods may have better than I thought.
I too have just noticed this recently, it's very annoying considering Hunger Points just goes by a 1-20, same with health, but Saturation is now tripled essentially. Just updated my mod a few days ago not realizing the Saturation until now, so I won't be able to get it updated during this weekend.
But thank you for the equation.
Hey, can you give a formula for the same thing with ranged item damage and knockback? It seems that power influences this.
You are a savior, this was so problematic for me.
I've created a simple calculator using Scratch to get the MCreator saturation values in case anyone's interested
https://scratch.mit.edu/projects/1006909814