Modify Food (Power Type)
Modifies the food values of items the holder eats.
Modifies the food the holder eats, without replacing it. Where apoli:edible_item hands one specific item a whole new food component, this scales the values an item already has — so a single power can double the nutrition of every item in a tag, halve everyone’s eating time, or strip the effects off raw meat.
Type ID: apoli:modify_food
Fields
| Field | Type | Default | Description |
|---|---|---|---|
item_condition | Item Condition Type | optional | If specified, the power only applies to items fulfilling this condition. Omit it and the power applies to everything the holder eats. |
food_modifier | Attribute Modifier | optional | Applied to the item’s nutrition (hunger shanks). |
food_modifiers | Array of Attribute Modifier | optional | Several modifiers applied to the item’s nutrition. |
saturation_modifier | Attribute Modifier | optional | Applied to the item’s saturation modifier. |
saturation_modifiers | Array of Attribute Modifier | optional | Several modifiers applied to the item’s saturation modifier. |
eat_ticks_modifier | Attribute Modifier | optional | Applied to how long the item takes to eat, in ticks. |
eat_ticks_modifiers | Array of Attribute Modifier | optional | Several modifiers applied to the eating time. |
always_edible | Boolean | false | If true, the matching items can be eaten on a full hunger bar. Also accepted as can_always_eat. |
prevent_effects | Boolean | false | If true, the status effects the food would apply are dropped. |
replace_stack | Item Stack | optional | If specified, the holder is left with this stack after eating instead of whatever the food would normally leave (bowls, bottles, nothing). |
entity_action | Entity Action Type | optional | Executed on the holder after eating a matching item. |
item_action | Item Action Type | optional | Executed on the stack that was eaten. |
The singular and plural spellings are the same field —
food_modifieris read as a one-entryfood_modifiers. Write whichever reads better; do not write both.
How it behaves
The power hooks eating itself, so it applies to vanilla food, modded food and apoli:edible_item food alike. Every matching power on the holder is applied in turn, so two powers that each double nutrition quadruple it.
Order of operations when the holder finishes eating something:
- Every
apoli:modify_foodon the holder whoseconditionanditem_conditionpass is collected. food_modifiersandsaturation_modifiersare applied to the item’s own values.prevent_effectsdrops the effect list;replace_stackoverrides what the item converts into.- Hunger and saturation are restored, then the surviving effects roll.
item_actionruns on the eaten stack, thenentity_actionon the eater.
eat_ticks_modifiers are applied earlier — when the eating animation starts — because that is when the game asks how long the item takes.
replace_stackuses vanilla’s “using converts to” slot, which only players get. A non-player holder eats the item normally and receives nothing back.
Examples
{
"type": "apoli:modify_food",
"item_condition": {
"type": "apoli:ingredient",
"ingredient": {
"tag": "minecraft:fishes"
}
},
"food_modifiers": [
{
"operation": "multiply_base_multiplicative",
"value": 1
}
],
"saturation_modifiers": [
{
"operation": "multiply_base_multiplicative",
"value": 1
}
]
} Doubles both the hunger and the saturation of every item in the minecraft:fishes tag.
{
"type": "apoli:modify_food",
"item_condition": {
"type": "apoli:food"
},
"eat_ticks_modifier": {
"operation": "multiply_base_multiplicative",
"value": -0.5
},
"always_edible": true
} Halves the eating time of anything edible, and lets the holder eat on a full hunger bar.
{
"type": "apoli:modify_food",
"item_condition": {
"type": "apoli:ingredient",
"ingredient": {
"tag": "minecraft:meat"
}
},
"prevent_effects": true,
"food_modifiers": [
{
"operation": "multiply_base_multiplicative",
"value": -0.5
}
],
"entity_action": {
"type": "apoli:apply_effect",
"effect": {
"effect": "minecraft:nausea",
"duration": 100
}
}
} Meat is half as filling, its own effects never apply, and eating it makes the holder nauseous.