Packet Guard

About

A client-side Fabric mod for Minecraft 1.21.11 that prevents disconnection from oversized item data. It intercepts outgoing CreativeInventoryActionC2SPacket and Pick Block operations, measuring serialized ItemStack size via RegistryFriendlyByteBuf encoding, blocking packets exceeding a configurable byte threshold (default 64KB) with chat warnings. Incoming protection hardens InventoryS2CPacket, ScreenHandlerSlotUpdateS2CPacket, and cursor packets by catching decoding exceptions and replacing problematic stacks with ItemStack.EMPTY, plus guards against excessive container component nesting depth. Features JSON configuration in Fabric config directory, client commands for status/threshold/toggle, and session block counters.