Food properties in 1.21
SiverDX opened this issue ยท 2 comments
posts the FoodValuesEvent
calls FoodHelper#query
and afterwards posts the event again with the modified values from said event (meaning the modification happens twice)
defaultFood
is also not final, meaning other mods could modify it
for neoforge I also recommend using getFoodProperties
instead
The double event is a bug.
defaultFood
being non-final is intentional, since the use-case this was originally designed for was Hunger Overhaul + The Spice of Life working together, so:
- Hunger Overhaul changed the default and modified values for every food
- The Spice of Life changed the modified food values (depending on how often that food has been eaten by that player), but left the default alone
AppleSkin can then render the tooltip like this (this is from an old AppleSkin version):
getFoodProperties
does seem like the better thing to use