Skip to content

Frequently Asked Questions

Wes Cook edited this page Jun 20, 2018 · 10 revisions

How is nutrition calculated?

A food's nutrition value is determined primarily by its hunger value. The number of half-drumsticks determines the base value. This value is then halved, and multiplied by a factor specified in the config file (default 1.0). Finally, a loss value is subtracted for each additional nutrient a food includes, which can also be configured.

For instance, Steak has a base food value of 8 (4 drumsticks). This is halved (4.0), and then multiplied by the config value (still 4.0). As Steak only has one nutrient (Protein), no loss is applied. A value of 4.0% is added to Protein.

Rabbit Stew has a base food value of 10 (5 drumsticks). This is halved (5.0), and multiplied by the config value (still 5.0). However because Rabbit Stew has two nutrients, a default loss penalty of 15% is applied. A total of 4.25% is then added to both Protein and Vegetable.

Cakes always have a base value of 2. Their final value is still dependent on nutrient count and other multipliers.

The complete formula is as follows:

Math.max(0, (food_value * 0.5 * nutrition_multiplier) - ((food_value * 0.5 * nutrition_multiplier) * (loss_per_nutrient / 100) * (nutrients_in_food - 1)))

What types of foods are supported?

Currently foods registered as ItemFood, BlockCake, or ItemBucketMilk are supported.

Cakes are a special exception as they can have separate item and block forms. The item form is used for the tooltip, and the block form is used to actually add nutrition to your player when eaten. So if the cake has both a block and item form, be sure to add them both to the nutrition list.

Is this mod required on both the client and server?

This mod is required on the server, and highly recommended on the client.

The server will still track nutrition and apply effects, even if the client is fully vanilla. However without the GUI this can only be communicated to the client through (op-only) commands and active effects. Additionally, modded potion effects will not display on the client-side.