Modify Food
Executes an Entity Action Type and modifies the food and saturation level gain of a food item when a player that has the power eats food item.
Type ID: origins:modify_food
Note
The actual food saturation level of the food item is determined by the food * saturation * 2 formula. If you are going to refer to the Minecraft Fandom Wiki: Food (Nourishment value)' page for the saturation value of the food item, you would have to divide the value by 2.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
item_condition |
Item Condition Type | optional | If specified, the specified modifier(s) will only apply to food items that fulfills this condition. |
food_modifier |
Attribute Modifiers | optional | If specified, this modifier will apply to the food amount gained by eating a food item. |
food_modifiers |
Array of Attribute Modifiers | optional | If specified, these modifiers will apply to the food amount gained by eating a food item. |
saturation_modifier |
Attribute Modifiers | optional | If specified, this modifier will apply to the saturation amount gained by eating a food item. |
saturation_modifiers |
Array of Attribute Modifiers | optional | If specified, these modifiers will apply to the saturation amount gained by eating a food item. |
entity_action |
Entity Action Type | optional | If specified, this action will be executed on the player that has ate an item. |
always_edible |
Boolean | false |
Determines whether a food item can be eaten regardless of the player's hunger bar being full. |
Examples
{
"type": "origins:modify_food",
"item_condition": {
"type": "origins:ingredient",
"ingredient": {
"item": "minecraft:dried_kelp"
}
},
"food_modifier": {
"name": "Increased food points",
"operation": "addition",
"value": 3.0
},
"saturation_modifier": {
"name": "Increased saturation points",
"operation": "addition",
"value": 1
}
}
This example will add 1 and a half shanks of hunger, and 1 saturation point if a player eats a dried kelp, totalling to 2 shanks of hunger and 6.4 saturation points.