Skip to content

Datapack Support

Maire edited this page Jun 1, 2026 · 5 revisions

Datapack Support

Nourished is built to be extended. Everything from food classifications to custom nutrients to effect rules can be added or overridden through a standard Minecraft datapack β€” no code required.


πŸ“ Folder Structure

All Nourished datapack files live under:

data/<your_namespace>/nourished/

For example, a modpack called mypack would use:

data/mypack/nourished/food_classifications/my_foods.json
data/mypack/nourished/effects/my_effect.json

Nourished supports the following directories:

Directory What it does
food_classifications/ Map specific items or tags to a nutrient
nutrients/ Add custom nutrient groups
effects/ Add custom nutrition-linked effects
diet_profiles/ Define preset configurations for modpacks
compat/ Register explicit mod compatibility entries
food_families/ Extend keyword-to-food-group mappings
module_locks/ Lock or enforce config settings server-side

Synergies, food synergies, and milestones are defined but not yet active. They're coming in a future version.


πŸ₯• Food Classifications

Path: data/<namespace>/nourished/food_classifications/<id>.json

Maps a specific item or item tag directly to a nutrient group. This is the most common use case β€” telling Nourished exactly what a food is.

By item

{
  "nourished_schema_version": 1,
  "nutrient_key": "vegetables",
  "item": "farmersdelight:tomato",
  "amount": 0.08
}

By tag

{
  "nourished_schema_version": 1,
  "nutrient_key": "proteins",
  "tag": "#farmersdelight:foods/cooked_meat",
  "amount": 0.10
}
Field Required Description
nutrient_key βœ… Target nutrient (fruits, vegetables, proteins, grains, dairy)
item One of Specific item ID
tag One of Item tag (prefix with #)
amount βœ… How much this food fills the bar (0.0–1.0)

Use item or tag β€” not both. If you use tag and no items are registered under it yet, the file will be skipped.


πŸ§ͺ Custom Nutrients

Path: data/<namespace>/nourished/nutrients/<id>.json

Add a new nutrient group beyond the defaults. The file name becomes the nutrient key.

{
  "nourished_schema_version": 1,
  "display_name": "Spices",
  "color": -3140895,
  "default_decay_rate": 0.0005,
  "critical_threshold": 0.1,
  "low_threshold": 0.25,
  "excess_threshold": 0.9,
  "beneficial": true,
  "icon": "minecraft:dried_kelp",
  "tags": ["nourished:nutrients/spices"]
}
Field Required Description
display_name βœ… Display name shown in the HUD and Diet Screen
color ARGB int for the bar color
default_decay_rate How fast the nutrient drains (per tick)
critical_threshold Threshold for critical penalty effects
low_threshold Threshold for low-level penalty effects
excess_threshold Threshold for bonus effects
beneficial Whether the nutrient gives positive effects
icon Item ID used as the bar icon
tags Item tags that map to this nutrient

✨ Custom Effects

Path: data/<namespace>/nourished/effects/<id>.json

Add a new nutrition-linked status effect.

{
  "nourished_schema_version": 1,
  "nutrient_key": "proteins",
  "threshold": 0.2,
  "threshold_type": "LOW",
  "effect_id": "minecraft:weakness",
  "amplifier": 0,
  "duration": 300
}
Field Required Description
nutrient_key βœ… Which nutrient triggers this effect
threshold βœ… The trigger point (0.0–1.0)
threshold_type βœ… LOW / CRITICAL (penalty) or BONUS / EXCESS (buff)
effect_id βœ… Vanilla or modded effect ID
amplifier Effect level (0 = level I)
duration Duration in ticks (20 ticks = 1 second)

πŸŽ›οΈ Diet Profiles

Path: data/<namespace>/nourished/diet_profiles/<id>.json

Define a named configuration preset β€” useful for modpacks that want to ship a specific balance. Players can select profiles from the config screen.

{
  "nourished_schema_version": 1,
  "display_name": "Hardcore Mode",
  "description": "Nutrients decay faster and penalties hit harder.",
  "custom_thresholds": {
    "proteins": 0.4,
    "grains": 0.4
  },
  "custom_decay_rates": {
    "proteins": 0.002,
    "grains": 0.002
  },
  "bonus_effects": [
    "minecraft:regeneration"
  ]
}
Field Required Description
display_name βœ… Name shown in the profile picker
description Short description
custom_thresholds Per-nutrient threshold overrides
custom_decay_rates Per-nutrient decay rate overrides
bonus_effects Additional effects applied when this profile is active

πŸ”Œ Compat Entries

Path: data/<namespace>/nourished/compat/<id>.json

Register explicit item-to-nutrient mappings for a specific mod. Useful for mods that Nourished doesn't automatically recognize.

{
  "nourished_schema_version": 1,
  "mod_id": "examplemod",
  "category": "FOOD_MOD",
  "mappings": {
    "examplemod:mystery_fruit": "fruits",
    "examplemod:protein_bar": "proteins"
  }
}
Field Required Description
mod_id βœ… The mod being registered
category FOOD_MOD, FARMING_MOD, or SURVIVAL_OVERHAUL
mappings Object mapping item IDs to nutrient keys

🌿 Food Families

Path: data/<namespace>/nourished/food_families/<id>.json

Extend the keyword classification system. Nourished uses item name keywords to guess food groups β€” this lets you add new keyword-to-group mappings or override existing ones.

{
  "nourished_schema_version": 1,
  "families": {
    "vegetables": ["gourd", "squash", "yam"],
    "proteins": ["jerky", "patty", "schnitzel"]
  }
}

Keywords are matched against item display names during classification. The more specific your keywords, the more accurate the results.


πŸ”’ Module Locks

Path: data/<namespace>/nourished/module_locks/<id>.json

For modpack authors who want to lock certain Nourished config settings so players can't change them. server_only additionally prevents clients from overriding those settings.

{
  "nourished_schema_version": 1,
  "locked": ["enableEffects", "enableRawFoodPenalty"],
  "server_only": ["bonusEffectThreshold", "penaltyEffectThreshold"]
}

This is useful for difficulty-locked modpacks or servers that need a consistent experience across all players.


πŸ’‘ Tips

Test with /reload. Datapacks reload with the standard /reload command β€” no restart required.

Prefer tags over items. Using #tag in food classifications covers all items in that tag automatically, including items from other mods that use the same tag.

Schema version. Always include "nourished_schema_version": 1 in your files. Nourished validates against it and will warn you in logs if it's missing or wrong.

Check the logs. If something isn't loading, Nourished logs detailed errors for malformed or missing files. Look for [NourishedDataLoader] in your latest.log.


πŸ“š Related Pages

Clone this wiki locally