Skip to content

Nutrients

Jason Mitchell edited this page Apr 29, 2023 · 1 revision

Nutrients act as unique food groups. Each nutrient contains a list of foods which increases that nutrient upon consumption.

Nutrition GUI

Nutrients are defined in the /config/nutrition/nutrients directory. Each .json file defines a new nutrient.

{
    "name": "example",            // Unique nutrient ID
    "icon": "minecraft:carrot",   // Item drawn in nutrient GUI
    "color": "72dd5a",            // Hexadecimal color used to draw for nutrient bar
    "decay": 2.5,                 // Override global decay multiplier
    "visible": true,              // Will this nutrient be visible in the GUI and tooltips
    "enabled": false,             // Will this nutrient be loaded in-game
    "food": {                     //
        "oredict": [              // List of ore dictionary entries that are included in this nutrient
            "listAllveggie",      //
            "listAllgreenveggie"  //
        ],                        //
        "items": [                // List of item IDs for foods that are included in this nutrient
            "minecraft:carrot",   //
            "minecraft:apple:1",  //
            "minecraft:cake"      //
        ]
    }
}

The name, icon, and color fields must be specified. Other fields are optional, however at least one food category should be included.

Localizations

Localization support can be added using the standard Resource Pack system. For modpack authors who would like to include localization support without requiring resource packs, the mod Resource Loader can be used.

The format for nutrients is as follows:

nutrient.nutrition:grain=Grain
nutrient.nutrition:fruit=Fruit
nutrient.nutrition:vegetable=Vegetable
nutrient.nutrition:protein=Protein
nutrient.nutrition:dairy=Dairy
Clone this wiki locally