====== minecraft:food ======
The ''minecraft:food'' item component adds nutrition points and saturation to its user after consuming the item.
Its values may be overridden for a specific item stack by using the [[mc>Item_format/1.20.5#food|minecraft:food]] item stack component.
Note that not all vanilla fields are still used in the item stack component.
This item component is usually combined with [[items:item_components:use_duration|minecraft:use_duration]], [[items:item_components:use_animation|minecraft:use_animation]] and [[items:item_components:consumable|minecraft:consumable]].
===== Fields =====
^ Name ^ Description ^ Type ^ Default Value ^
| ''nutrition'' | How many nutrition points to add after consuming. | A non-negative integer |
| ''saturation'' | How much saturation to add after consuming. | A float | |
| ''always_edible'' | Whether the food item is edible, regardless if a player's hunger bar is full or not. | An optional boolean | ''false'' |
| ''effects'' | The [[#possible effect|possible effects]] to add after consuming. | An optional list of [[#possible effect|possible effects]] | ''[]'' |
===== Example =====
{
"nutrition": 2,
"saturation": 1.2,
"effects": [
{
"effect": {
"id": "minecraft:poison",
"duration": 100,
"show_icon": true
},
"probability": 0.6
}
]
}
===== Possible Effect =====
An effect that may or may not be applied after consuming.
==== Fields ====
^ Name ^ Description ^ Type ^ Default Value ^
| ''effect'' | An [[mc>Effect|effect instance]]. | An [[mc>Effect|effect instance]] | |
| ''probability'' | The probability of applying the effect. | A float ranging from ''0.0'' to ''1.0'' inclusive | ''1.0'' |
==== Example ====
{
"effect": {
"id": "minecraft:poison",
"duration": 100,
"show_icon": true
},
"probability": 0.6
}