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
| Field | Type | Default | Description |
|---|---|---|---|
nutrition | integer | 0 | How many hunger points the food fills (2 points is one drumstick). |
can_always_eat | boolean | false | When true, players can eat it even with a full hunger bar, like a golden apple. |
saturation_modifier | number | 0.6 | How long the food keeps you full. The saturation gained is nutrition x this value x 2.Range: 0 to … |
using_converts_to | Item Descriptor | none | An 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": {}
}
}