minecraft:food
When an item has a food component, it becomes edible to the player. Must have the 'minecraft:use_duration' component in order to function properly.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
nutrition | Integer | 0 | Value that is added to the entity's nutrition when the item is used. Default is set to 0. |
can_always_eat | Boolean | false | If true you can always eat this item (even when not hungry). Default is set to false. |
saturation_modifier | Decimalmin 0 | 0.6 | saturation_modifier is used in this formula: (nutrition * saturation_modifier * 2) when applying the saturation buff. Default is set to 0.6. |
using_converts_to | Text or Object | — | When used, converts to the item specified by the string in this field. Default does not convert item. |
Example from the game files
This is how vanilla appleEnchanted uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:food": {
"nutrition": 4,
"saturation_modifier": "supernatural",
"can_always_eat": true,
"effects": [
{
"name": "regeneration",
"chance": 1.0,
"duration": 30,
"amplifier": 1
},
{
"name": "absorption",
"chance": 1.0,
"duration": 120,
"amplifier": 3
},
{
"name": "resistance",
"chance": 1.0,
"duration": 300,
"amplifier": 0
},
{
"name": "fire_resistance",
"chance": 1.0,
"duration": 300,
"amplifier": 0
}
]
}
}Used by 40
Vanilla items with minecraft:food in their definition:
appleappleEnchantedbaked_potatobeefbeetrootbeetroot_soupbreadcarrotchickenchorus_fruitclownfishcooked_beefcooked_chickencooked_fishcooked_porkchopcooked_rabbitcooked_salmoncookiedried_kelpfishglow_berriesgolden_applegolden_carrothoney_bottlemelonmushroom_stewmuttonCookedmuttonRawpoisonous_potatoporkchoppotatopufferfishpumpkin_pierabbitrabbit_stewrotten_fleshsalmonspider_eyesuspicious_stewsweet_berriesSet it without writing JSON
The item maker writes this component for you from a form and puts it in a ready-to-import .mcaddon.