Modify Food

Power Type

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 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 actions and modifier(s) will only apply to food items that fulfills this condition.
item_action Item Action Type optional If specified, this item action type will be executed on the remaining item stacks that was consumed.
replace_stack Item Stack optional If specified, this item stack will replace the item stack that was consumed after consuming it.
food_modifier Attribute Modifier 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 Modifier 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 a food item.
always_edible Boolean false Determines whether a food item can be eaten regardless of the player's hunger bar being full.
prevent_effects Boolean false If set to true, prevent status effects from being applied.

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.