Overview
Food that is not immune gains a spoilage component and moves through named stages (default 1 / 2 / 3 / 2 / 2 minutes: Fresh, Good, Stale, Rotting, Rotten). Nutrition and saturation drop each stage. When the last stage fills, the stack is replaced (default rotten flesh). Fresh food has a chance to grant buffs, near rotten food has a chance to give debuffs. Highly configurable.
How to prevent or slow spoilage
- Never spoil: server
neverSpoillist accepts item ids or#tags. Defaults include golden foods, rotten flesh, chorus fruit, honey bottle,#c:foods/honey, and#c:foods/golden. - Rate 0: a
rateOverridesentryid_or_tag=0also stops spoilage. - Containers: ender chest default rate is 0. Barrels, pots, and bundles are slower than a chest or your inventory.
- Modifiers (one per exclusive category; preservation is exclusive):
- Cured: craft with bone meal
- Brined: craft with an awkward potion (not sweets)
- Candied: craft with a honey bottle (not soups)
- Dried: campfire on common meat / fish / fruit / veg / mushroom tags
- Smoked: smoker on cooked meat / fish (stronger than Dried)
- Frozen: ice items, or stay cold long enough (Cold Sweat Icebox is instant)
- Temperature: cold biomes and body temp slow spoil, heat speeds it. Frozen food cannot be eaten until it thaws (craft with hot items, Boiler, or warmth).
Tooltips (hold Shift for ALT lines): stage, modifiers, container rate, freeze/thaw progress, remaining time. Client modifierHighlight is NONE / OUTLINE / TINT / BOTH (default OUTLINE) for modifiers with tint_item.
Compat
- AppleSkin: hunger and saturation overlays use spoilage-scaled values. The mod's own effective-food tooltip line is hidden so the two do not stack. Frozen food hides the AppleSkin overlay because it cannot be eaten.
- Cold Sweat: player body temperature can drive inventory food instead of biome air temp. Icebox freezes food in its inventory; Boiler thaws it.
- EMI: recipe pages for every datapack apply and remove craft, plus smoker (Smoked) and campfire (Dried). Dynamic dummy recipes are hidden.
Datapack makers
Synced registries:
data/<namespace>/fffoodspoilageandpreservation/modifier_category/<id>.jsondata/<namespace>/fffoodspoilageandpreservation/modifier/<id>.json
Category fields: priority, exclusive, display_name.
Modifier fields: category, priority, rate_multiplier, prevent_eating, display_name, tooltip_color, tint_item, item_tint, apply_items, remove_items, food_whitelist, food_blacklist, auto_apply_when_cold, auto_remove_when_warm.
apply_items may be an item, a #tag, or minecraft:potion#minecraft:awkward. A non-empty whitelist restricts foods; otherwise every spoilable food is allowed except the blacklist.
Cooking recipes (same stack, modifier applied):
"type": "fffoodspoilageandpreservation:modifier_smoking"(smokers)"type": "fffoodspoilageandpreservation:modifier_campfire"(campfires)
Built-in ids: preservation, temperature, cured, brined, candied, dried, smoked, frozen. Old saves with "cured" resolve to fffoodspoilageandpreservation:cured.
Item tags you may overlay: #fffoodspoilageandpreservation:never_spoil, #fffoodspoilageandpreservation:soups, #fffoodspoilageandpreservation:smokable.
Modding API
Package com.fyxe.fffoodspoilageandpreservation.api:
SpoilageStageAdvancedEventFoodSpoiledEvent(cancellable replacement)ModifierChangedEvent:ResourceLocationid, applied or removed
Look up defs with ModifierLookup and level.registryAccess() (ModRegistries.MODIFIER / MODIFIER_CATEGORY).
What's with the FF prefix?
It stands for Fyxe's Features! Its a clean way to easily find all of my mods when changing configs or creating packs. Mods that are a part of the "FF" system are usually smaller and unintrusive.
Feedback
If you have any ideas for improvements, questions, or concerns, I am open to communicating through email: [email protected]