I would like to read the value of foodExhaustionLevel in the player's foodStats. I have successfully used reflection to get access, but this only works in the dev environment, not the compiled code.
I have tried experimenting with ObfuscationReflectionHelper, but I am not sure how it works.
This is what I have so far:
FoodStats stats = player.getFoodStats();
Class c = stats.getClass();
// Field f = ReflectionHelper.findField(stats.getClass(), "foodExhaustionLevel");
Field f = ObfuscationReflectionHelper.getPrivateValue(stats, <What goes here?>, "foodExhaustionLevel");
Can anybody help?