1. Wiki
  2. /Items
  3. /minecraft:food

minecraft:food

Don't want to write this by hand? GodCraft sets minecraft:food for you with a switch.Get GodCraft

Overview

minecraft:food is an item component: it goes in the components object of a custom item. Makes the item edible so it restores hunger when eaten. Add minecraft:use_modifiers with a use_duration too, or the item cannot be eaten properly.

Fields

FieldTypeDefaultDescription
nutritioninteger0How many hunger points the food fills (2 points is one drumstick).
can_always_eatbooleanfalseWhen true, players can eat it even with a full hunger bar, like a golden apple.
saturation_modifiernumber0.6How long the food keeps you full. The saturation gained is nutrition x this value x 2.Range: 0 to …
using_converts_toItem DescriptornoneAn item left behind after eating, like an empty bowl after stew.

Example

Inside the components object of BP/items/<name>.json (values are the defaults or placeholders):

BP/items/<name>.json
{
  "minecraft:food": {
    "nutrition": 0,
    "can_always_eat": false,
    "saturation_modifier": 0.6,
    "using_converts_to": {}
  }
}

Items: Behavior pack

We use cookies to improve your experience and analyse site traffic. Learn more