FoodTweaker

FoodTweaker

9k Downloads

Saturation value getting set higher than expected

luke-bravenboer opened this issue ยท 1 comments

commented

The 'saturation' value is getting multiplied by the 'heal' argument passed to the changeFoodStats method, making it result in a much greater saturation value than expected.

For example, if I set a bunch of foods to have the exact same saturation value, but with different 'heal' values, they end up with wildly different saturation amounts, proportional to whatever the 'heal' value was.

Example script:

import mods.foodtweaker.changeFoodStats;
changeFoodStats(<minecraft:cooked_chicken>,  1,  2.0);
changeFoodStats(<minecraft:cooked_mutton>,   2,  2.0);
changeFoodStats(<minecraft:cooked_porkchop>, 4,  2.0);
changeFoodStats(<minecraft:cooked_beef>,     8,  2.0);
changeFoodStats(<minecraft:golden_carrot>,   16, 2.0);

Resulting screenshot:
results

commented

This is vanilla behavior.
I am pretty sure saturation is a modifier based on the healAmount of the food.
So if the healAmount is 2 having saturation set to 2.0F = 2*2 = 4 bars.
Which would explain the increase you got. I will be sure to add a note to the wiki