Well Seasoned Compat
A small fix for Well Seasoned 0.5.2 on Minecraft 1.21.1 (NeoForge). Install it next to Well Seasoned; it does not replace it and does not change any config or data pack.
The crash
Well Seasoned turns the effects on a food’s food properties into its own effect entries, and it rejects a timed effect whose duration is not positive:
java.lang.IllegalArgumentException: Effect duration must be positive
That error escapes while a tooltip is being built. Because the creative inventory search index reads every item tooltip when it is built, opening the search tab with the right food present crashes the client. The same food can also crash when hovered or eaten. It is not caused by anything typed into the search box.
Some foods from other mods carry such an effect, and Well Seasoned fails on the whole item instead of the single effect. The rebalance data that ships with a pack is not at fault: its own effect durations are valid.
What the fix does
- A timed effect with an invalid duration is skipped, so the rest of the tooltip and the rest of the meal still work.
- A zero-duration instant effect is kept and treated as one tick, so it still applies.
- Valid timed effects, infinite effects, amplifiers, ambient/hidden/icon flags, chances, and effects configured in Well Seasoned are passed through unchanged.
Both the tooltip path and the eating path go through the patched code, so fixing one also fixes the other.
Limits
- Built for Well Seasoned 0.5.2 only. Other versions are not supported by this build.
- Invalid effects are dropped quietly rather than repaired, because the intended duration is unknown.
- Not tested in a live game yet. The crash was reproduced offline and the patch was checked against the same code path, not by opening the search tab in game.
Install
Put the jar in mods on the client and the server, alongside Well Seasoned 0.5.2. It is a separate jar: removing it
restores the original behaviour immediately.
1.0.0
Released
-
Minecraft 1.21.1, NeoForge
Download NeoForge for 1.21.1- Requires
- Well Seasoned 0.5.2 (exact version), NeoForge 21.1.266, Java 21 or newer
- File size
- 3675 bytes
- SHA-256
de3bc3ac5db82e61cc02b836358b2de34d094133e44867870a9b25651dca10aa
Changelog
- Skips invalid timed food effects instead of crashing tooltips, creative search and eating.
- Keeps zero-duration instant effects so they still apply.
Not tested in a live game yet; the crash was reproduced and the patch verified offline.