Description
Thirst Was Taken: Server Fix
🔧 What is this mod?
A critical patch mod that fixes NBT tag synchronization crashes affecting ItemStack serialization during server-client communication. Originally discovered and solved for Thirst Was Taken and Thirst-No-More mods, this fix is universally applicable to any mod suffering from null ItemStack crashes during Netty packet encoding.
🐛 The Problem
Several mods (particularly water/drinking container mods) use ItemStack.getOrCreateTag() patterns that can inadvertently create NBT tags containing null ItemStack references. When these items are synced from server to client, the Netty encoder attempts to serialize null ItemStack objects, resulting in:
EncoderException: Cannot invoke net.minecraft.world.item.ItemStack.m_41619_()
because p_130056_ is null
This crash prevents players from joining the server entirely.
✅ The Solution
This mod uses Forge Mixins to inject protective patches at the network layer without modifying the original mods:
- FriendlyByteBufItemStackMixin: Intercepts all ItemStack writes to network packets and safely replaces null ItemStack references with
ItemStack.EMPTY, maintaining packet protocol integrity - ItemStackNullSafetyMixin: Protects critical ItemStack serialization methods (
save(),getMaxStackSize(),isEmpty(),getItem())
🎯 Why This Mod?
- No source modification needed - Mixins patch at runtime
- Universal solution - Works with any mod that has null ItemStack issues
- Safe - Replaces nulls with valid empty stacks, maintaining server stability
- Transparent - Zero configuration needed, works immediately on install
📋 Compatibility
- Minecraft: Actually only in 1.20.1
- Works with: Thirst Was Taken, Thirst-No-More, and any mod with ItemStack NBT sync issues
🔍 Origin
This fix was developed to solve critical join crashes in servers using Thirst Was Taken and Thirst-No-More mods. The underlying issue (null ItemStack in NBT serialization) can occur in any mod, so this solution is provided as a universal patch.
Issues? Report them along with your latest.log if you encounter any problems.


