API request
VladoCC opened this issue ยท 3 comments
Okey, @progwml6 said that I need towrite issue here to ask about api for Get Back To Home mod.
I want to get:
-Food values (hunger, saturation)
-Some way to get how exhaustion works with your mod. You changes it in some pats, right?
If my mod was loaded earlier than HO, can it get values changed by HO from AppleCore API?
And is it all changes to exhaustion? I think that I saw some info about formula for speeding down exhaustion when player is low on hunger.
If my mod was loaded earlier than HO, can it get values changed by HO from AppleCore API?
Yes, load order doesn't matter at all for this (or anything else AppleCore related, I believe).
And is it all changes to exhaustion? I think that I saw some info about formula for speeding down exhaustion when player is low on hunger.
Depends what you mean by exhaustion. If you mean the FoodStats.foodExhaustionLevel
field, then, yes, what I linked are the only changes to how that works. If you mean 'exhaustion' as a general concept, then HO does do some other stuff like apply potion effects when the player is low on hunger/health.
Food values can be retrieved using the AppleCore API (which is what Hunger Overhaul uses under the hood to modify food values):
Example:
AppleCoreAPI.accessor.getFoodValues(itemStack);
HO affects exhaustion in a few ways:
- Adds constant exhaustion increase when
Config.constantHungerLoss
is true - Disables losing hunger from exhaustion when
Config.hungerLossRatePercentage
is 0 - Modifies the threshold for losing hunger from exhaustion based on
Config.hungerLossRatePercentage
(the modified max exhaustion can be retrieved using the AppleCore API like so:AppleCoreAPI.accessor.getMaxExhaustion(player)
; real world example here)