Host your Minecraft server on BisectHosting - get 25% off your first month with code MODRINTH.

Purpose

Mostly to give me a reason to care at all about other foods beyond chicken/beef and golden vegetables. However, its implemented in a way that improves the game in multiple ways:

  • A reason to try new foods
  • A reason to avoid unnecessary chip damage (get better at parkour, mlg water bucket, travel safely, etc)
  • Harder survival (without being restrictive or annoying)

Its not meant to add a ton of difficulty, just enough to get the player considering those things.

Details

In short, it creates a challenge that limits your health regeneration until you eat unique foods. Eating all the foods from "A Balanced Diet" achievement removes all restrictions on health regeneration.

However, the challenge can be disabled in-game, which just leaves a QoL tracker for the achievement.

New Tracker

A new advancement tab will be unlocked that shows which foods you have and haven't eaten for the vanilla "A Balanced Diet" advancement (full overview in Gallery).



The datapack as two modes:

  • Challenge mode:
    • Enables the health regen limitations and tracker
  • Tracker mode:
    • Enables only the tracker of foods eaten

The two modes can be freely switched between during gameplay using the following commands:

/function balanced_diet:mode/tracker
/function balanced_diet:mode/challenge

All progress towards the advancement will continue regardless of which mode you're in. Each player is tracked individually and doesn't have to be in the same mode as other players.

Challenge Mode

(enabled by default)

You start the game with a total of 10 hearts, as normal. However, only 1 heart is a normal red heart, the other 9 are yellow absorption hearts. Absorption hearts do not regenerate naturally once lost.



For each 4 unique foods you eat, you will permanently gain 1 red heart:

Absorption Regeneration

Adsorption hearts are regenerated everyday at dawn to fill all 10 heart slots, regardless of whether or not the player sleeps. Extra absorption hearts are never removed though, so permanent overhealth is possible if you eat many unique foods without taking damage.

Absorption hearts are also regenerated when you respawn after dying.

Completion Details

Due to rounding, the final 2 hearts require 6 foods, not 4.

Table of food needed for red hearts
Unique Food Red Hearts
0 1
4 2
8 3
12 4
16 5
20 6
24 7
28 8
34 9
40 10

Perfomance

No detectable performance impact. All of the tracking happens via advancements, the same way its tracked in the vanilla game. Only a few simple functions are ran on ticks.

Limitations

  • If added to a pre-existing world, the datapack will not recognize any foods you've eaten before you added it.

  • Absorption can only be given in 2 heart increments. When only 1 heart is needed, 1 heart of damage will automatically be dealt to balance it. Checks are in place to ensure the damage is not dealt when it is not necessary.

  • The player will continuously be under the absorption effect. While particles are disabled on it, you can still see the effect active while in the inventory.

Uninstall

To uninstall and remove all traces of the datapack, run the following command:

/function balanced_diet:uninstall

Note, there will be a notification after its done to run the /datapack disable command on it. It can't do that final step itself due to the bugs it'd cause if the pack were to be renamed (which it is automatically on some sites).

External resources



Project members

Kamorzy

Owner


Technical information

License
LGPL-3.0-or-later
Project ID