Skip to content
CapitanSuk edited this page May 4, 2026 · 15 revisions

Welcome to the Food Update wiki!
Here you will learn how to change the food balance and create your own addon for the datapack.

This page is under construction

Basics. Presets

Presets are a key element of Food Update 2.0 They determine what effects player will gain or lose from eating food. Each preset is written in a function file (.mcfunction) and looks something like this:
data merge storage food_update:effects {\
\
Apple:[\
{id:"regeneration",duration:8,amplifier:1}],\
\
Honey_Bottle:[\
{id:"haste",duration:120},\
{clear:"wither"}]\
\
}

The \ character is used to break lines without breaking commands. This will greatly improve a readability of the preset, since a preset is essentially one huge command.
Be careful: spaces, missing commas, and extra brackets will cause errors when loading your preset.

This example illustrates the structure of presets

Example Syntax Description
data merge storage food_update:effects { A data merge command that you should not change. "{" opens data for merging
Apple:[ <FU_ID>:[ A "FU_ID" referenced by the datapack to determine what effects to apply after player consumes an item. "[" opens the list of effects.

In the default datapack, FU_ID corresponds to a Camel_Snake_Case item identifier entry. For example, minecraft:apple becomes Apple, and minecraft:cooked_beef (a steak) becomes Cooked_Beef. The only exception: Water_Bottle
{id:"regeneration",duration:8,amplifier:1}], {id:"<effect ID>",duration:<effect duration>,amplifier:<effect amplifier>}], An only effect for this FU_ID. All data you enter here is used for the "/effect give" command. "]" closes the list of effects. Note that there is a comma at the end, as the FU_ID list continues.

You can find the effect IDs and learn about the /effect command on the Minecraft Wiki. Please note that some effects use duration in ticks rather than seconds.
Honey_Bottle:[ <FU_ID>:[ Next FU_ID
{id:"haste",duration:120}, {id:"<effect ID>",duration:<effect duration>}, A first effect for this FU_ID. In the absence of an amplifier, the gain is zero. Note that the list of effects continues, so there is no square bracket at the end
{clear:"wither"}] {clear:"<effect ID>"}] A second effect for this FU_ID. In this case, the "/effect clear" command is used, as reflected in the syntax. Note that there is no comma at the end, as this is the last FU_ID in the list
} End of the data

Knowing this structure, you can create your own presets or modify existing ones to suit your needs. Food Update supports up to 255 effects per FU_ID, but this doesn't mean you have to use the full limit :)

Since the datapack uses the /effect command to give and clear effects, it supports non-vanilla effects.

Preset loading

Each time the datapack is loaded, it will load all available presets. A preset will not affect FU_IDs that are not specified in it, but will completely overwrite effects for FU_IDs that are included in it. This can cause preset conflicts. For a more controlled result, Food Update uses the following loading order:

  • current default preset
  • old default presets (if applied)
  • #food_update:preset tag
  • #food_update:preset_forced tag
  • draft preset

Default presets

By default, the datapack only loads a preset from the file data/food_update/function/preset.mcfunction. However, it can also load some presets located in the .../function/preset folder, namely draft.mcfunction and old default presets if they were moved from the .../function/preset/old folder.

The datapack loads the old presets in order from newest to oldest.

Custom presets

After loading the default presets (except for the draft), the datapack loads custom presets included in the #food_update:preset and #food_update:preset_forced tags. It's recommended to place custom presets in the data/food_update/function/preset folder. Please give presets unique names to avoid unnecessary conflicts.

To add your preset to the load queue, open the data/food_update/tags/function/preset.json file and write the preset name to the comma-separated list, so it looks like {"values": [...,"food_update:preset/<your preset name without .mcfunction>"]}.

If you have multiple presets that partially conflict with each other, you can add a preferred one to the #food_update:preset_forced tag. In other cases, using this tag is not recommended.

Debugging

While working on a preset, you may need to make edits on the fly using the /data command. To disable automatic preset loading, enable debug mode with the command /function food_update:debug/on. Also, when debug mode is enabled, a message is sent to the chat each time an effect is applied to a player, helping you spot issues. To turn off debug mode, use the command /function food_update:debug/off.

Clone this wiki locally