Table of Contents

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 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 minecraft:use_duration, minecraft:use_animation and 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 effects to add after consuming. An optional list of 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 effect instance. An 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
}