Healthy DietFEATURE GUIDEEnglish
04 / SHELF LIFE

Shelf life: configuration and settlement

Explore eight item-editor sections to distinguish base time, temperature, spoilage and expiration; then follow food after it leaves your inventory, including trust and offline protection.

Eight editor sectionsServer settlementContainers & multiplayerOffline ledger
Configuration vs runtime: Configured base duration is not a live item’s remaining time; server datapacks and actual item state determine the result.

01How settlement works

First the item has a configured base duration. Environment changes item temperature; temperature curves, dimension multipliers and cold-fresh protection affect spoilage speed. The server settles remaining time. Temperature curves change decay, while the Effects section changes what happens when the food is eaten.

Base duration Whole minutes
→
Temperature Nature / fridge / freezer
→
Decay Curves / dimensions / freshness
→
Expiration Disappear or transform
One game day = 20 minutes; one real day = 1,440 minutes. Configured base duration, the item’s current temperature and its remaining lifetime are three different quantities.

02Eight editor sections

Hold an item and use /hdui in game to reach the shelf-life editor. Tabs below mirror its eight sections and are read-only explanations, not a way to save configuration.

01 / Time and expiration

Shelf life

Set base duration and base decay multiplier. The editor accepts minutes, hours, real days (1,440 minutes) or game days (20 minutes); the saved durationMinutes is an integer. A dimension without a configured multiplier uses ×1.

FieldMeaning
Duration / base multiplierStarting shelf life and base rate; multiplier 0 means no base decay.
Expiration result / inherit temperatureminecraft:air means disappearance. An expiration product can inherit temperature at that instant, but its own shelf life starts over.
Expiration commandRuns in the holder’s context only when held food expires; not for container contents or dropped items.
Dimension multipliersPer-dimension spoilage rates, not temperature offsets.

03Time away from the inventory and multiplayer protection

Food uses different clocks on a player, in a container and on the ground; the server settles it, while the client only advances a display at the rate the server sends.

Two clocks and server authority

Food in the player inventory, armor slots, off hand or cursor uses the player’s online playtime; it does not advance while the player is offline. Chests, refrigerators, other containers, dropped items and placed block foods use world time, which continues while the server is running. Food in the creative inventory or JEI does not tick.

Spoilage, temperature and cold-fresh progress are calculated by the server; the client sees a snapshot. The displayed number advances each second at the rate the server sends, so it looks live, but the server value is authoritative. Editing the client cannot create fresh food. Tooltip text and colors also follow the server’s scheme files.

Changing hands, logging in and changing dimension

When food changes hands, its clock is re-based from the moment the new owner receives it; a long-online previous owner does not make it spoil immediately. Logging in or changing dimension also re-bases the clock, and offline time is not added to carried food.

The inventory and dropped items refresh about every 20 seconds; press S to settle immediately and see current values. Opening a container, starting to eat or accessing a Tom storage terminal also refreshes the inventory without waiting for the next cycle.

Who owns an item

When shelf-tracked food is placed into a container, it receives the inserter’s owner mark. Other players see a red frame and cannot take it; protected food on the ground cannot be picked up either. Refrigerators and Tom storage terminals follow the same rule.

Only “placed into a container” creates ownership: if you take half of a wild chest’s contents, the remainder does not become yours merely because you touched it, and other players may still take it fairly. Conversely, food that has never been in a container has no owner; freshly crafted or picked-up food carried on your person can be given away freely. Once marked, ownership follows the item, so taking it back from your own chest into your inventory keeps it yours.

Hold S for details; if the owner is not you, an “Item owner” line appears at the bottom. The same food type with different owners cannot stack together and splits into two stacks, so marks are not overwritten.

Trust list and ownership transfer

Use /hdtrust to manage the trust list for your protected items; no OP is required:

CommandEffect
/hdtrust add <player>Adds an online player to the current trust list; they may take your protected food normally.
/hdtrust remove <player>Removes current trust but keeps the “formerly trusted” history; items already taken and not returned are transferred to that player.
/hdtrust forget <player>Clears both current trust and history, treating the player as never trusted.
/hdtrust listShows current and formerly trusted lists; clicking a name can remove or re-trust.

Trust always refers to the original owner: if a friend takes your food and puts it in their own chest, you remain the owner. If you throw food out, that counts as giving it away and the mark is cleared; if a friend takes your food and then throws it out, the same applies.

Death drops are not a gift: food that had no owner receives your mark at the moment you die, while already-owned food keeps its original owner. Strangers cannot pick it up; you and your trusted players can, and you can recover it after respawning. If the server enables removeOwnerOnDeathDrop (suited to PvP servers), death drops have their protection cleared and anyone may pick them up.

Frozen items: If a player who has never been trusted obtains another player’s protected food through pipes, commands or similar means, the item is frozen: its shelf life stops advancing, it cannot be eaten or drunk, and it cannot be placed into chests, furnaces or crafting grids or transferred. It only occupies inventory space and warns the holder. The server owner can enable ejectIllegalProtectedItems to drop such items at the holder’s feet; it is off by default to avoid harming whole batches if a trust file is damaged.

While every authorized player is offline, container food does not spoil

When the protected item’s owner and all currently trusted players are offline, time inside chests, refrigerators and other containers is not counted as spoilage; if any authorized person remains online, settlement continues normally.

Example: A trusts B. A logs off at 20:00, B logs off at 22:00, and A opens the chest at 08:00 the next morning. From 20:00 to 22:00 B is still online, so those 2 hours count normally; from 22:00 to 08:00 neither is online, so those 10 hours do not count at all.

The server records “all authorized players offline” intervals in an offline ledger. Containers are settled only when opened, so the deduction is applied when someone returns to look. The ledger records only intervals after it is enabled; earlier offline time cannot be recovered. Protected food dropped on the ground does not receive this protection and still spoils.

Containers, loot and dropped items

Closed chests are not scanned continuously. Each food records its last settlement time; opening the chest settles the whole interval at once using the previous temperature. Weather changes in the middle are not re-simulated segment by segment, so the result can differ slightly from continuous simulation, but it is close and costs almost no performance.

Opening a chest, clicking an item in it or pressing S settles immediately. Food in a chest that has not started ticking—for example, inserted by a command or another mod, or placed before shelf life was configured in an old save—receives a mark and starts its clock when the chest is opened or S is pressed. When a chest is broken, its contents are settled and their refrigerator state is cleared before they drop, so an item cannot “think it is still in a fridge” after landing. Hoppers and pipes inserting into chests follow the same merge rules, and merged stacks use the worse portion.

Food generated in loot chests or dropped by mobs receives a shelf-life mark at the moment it is created, as fresh food starting from zero; this also applies when mods such as Touhou Little Maid or Create place harvests directly into their inventory. Food you craft, cook or machine-process does not receive this treatment and starts timing only when a player or container first sees it.

Dropped items align to 20-second time slots; the same food type dropped in the same slot has identical shelf data, so it can still stack on the ground. The first short interval after landing is not counted, keeping the error in the player’s favor. Unloaded chunks are not simulated; when the chunk loads again, the intervening time is settled at once.

Placed block foods such as cake use world time: a chunk load settles once, and the same chunk is settled at most once every 3 minutes; force-loaded chunks such as FTB Chunks settle once per minute. Spoiled cake disappears or drops its expiration product; placing an already-spoiled cake immediately turns it into that product. A completely untouched cake can be broken and recovered with its original shelf life; a partially eaten cake cannot.

With Jade installed, pointing at dropped food adds a shelf-life line to the HUD, accurate to the second with one decimal place for percentages; the data still comes from the server. Food in chests and in hand continues to use item tooltips.

Stacking thresholds

ConditionDefault threshold
Remaining shelf-life differenceAt most 5 minutes
Item temperature differenceAt most 10°C
Cold-fresh progress differenceAt most 20 (0–100 scale)

All three conditions must be met to merge, and the merged stack uses the worse portion, so fresh food cannot “wash” a nearly spoiled stack. The thresholds can be adjusted in the shelfMerge section of config/healthy_diet/server.json. Dropped items require identical shelf data to stack; two stacks with different cold-retention ceilings also cannot merge.

Expiration commands and products

The expiration command runs only when food spoils while held by a player, or when a bite is taken from an already-spoiled cake; it does not run when food spoils inside a container or on the ground. The expiration product is a new item without the original NBT, keeping the count; if it does not fit, it returns to the inventory, and if the inventory is full it drops on the ground.