promotional bannermobile promotional banner

PacketFixer

A server-side Fabric mod (Minecraft 1.21.1, Java 21, v1.5.1, group com.packetfixer) that optimizes server→client network traffic.

A server-side Fabric mod (Minecraft 1.21.1, Java 21, v1.5.1, group com.packetfixer) that optimizes server→client network traffic. It's a DedicatedServerModInitializer, so it only runs on the server. It does two things: prevents crashes/disconnects caused by other mods' packets, and reduces bandwidth, latency, and network CPU.

The modules

  1. Anti-disconnect for broken mod packets (ClientConnectionMixin) Inserts a handler into the Netty pipeline and intercepts exceptionCaught: if the error is an EncoderException containing custom_payload (i.e. a broken packet from some mod), it logs a warning and swallows it instead of kicking the player.

  2. Custom payload throttling (PacketThrottler + Config → config/packetfixer.json) Max 50 custom payloads per tick per connection; the overflow goes into a queue (max 500, oldest dropped) and is resent at the start of the next tick using batched writes + a single Netty flush. It has adaptive congestion control: as the queue grows, the "live" budget scales down (back-pressure) while the flush budget scales up. Ping-critical packets (position, velocity, block update, inventory, health, sounds) always bypass the throttle, and the cobblemon namespace is excluded by default — clearly to avoid breaking battle packets.

  3. Flush consolidation Adds a Netty FlushConsolidationHandler to merge multiple flushes into fewer syscalls, with an adaptive threshold based on player count (few players = low threshold = better ping; many = higher threshold = less CPU). A tick-end "flush pulse" makes sure nothing gets stuck sitting in the buffers.

  4. Packet optimizers (PacketOptimizerConfig → config/packetoptimizer.properties)

  • NBT stripper (EntityNbtMixin): removes server-only tags (Paper.Origin, Bukkit.updateLevel, etc.) and empty compounds
  • Chunk optimizer (ChunkDataMixin): same cleanup for block entities in chunk data
  • Lazy entity loader (LazyEntityTracker): entities beyond 16 bloy, but in batches of ~10 per tick
  • Entity update throttle (EntityTrackerEntryMixin): entities more than 48 blocks from all players only send position updates every 3rd tick (~66% fewer packets)
  • Compression tuning: forces the Deflater to level 1 via reflection (faster, slightly larger packets)
  • Packet monitor (PacketEncoderMonitorMixin): logs warnings/erroMB — useful for finding which mod is sending huge packets

A couple of things worth knowing

ClientConnectionMixin uses reflection on the compressor's Deflatgile part, and it fails silently (catch + debug log) if theNetty/MC internals change. And the swallowed exceptionCaught means that if a mod genuinely has a serialization bug, the packet vanishes without the client ever knowing — intended here, but it can mask real problems.

PacketFixer Team

profile avatar
  • 3
    Projects
  • 5.0K
    Downloads

More from marcoercarrozza

  • CobblemonOptimizer project image

    CobblemonOptimizer

    CobbleOptimizer A server-side Fabric mod for Minecraft 1.21.1 that optimizes Cobblemon (the Pokemon mod) entity performance based on server load (TPS).

    • 3.0K
    • September 13, 2026
  • Cobblemon:CrzMovesPokemon project image

    Cobblemon:CrzMovesPokemon

    ● CRZMovesPokemon This mod fixes and expands Pokemon movesets for Cobblemon 1.7 by sourcing accurate move data from Pokemon Central Wiki (the Italian Pokemon encyclopedia).

    • 1.4K
    • September 13, 2026
  • CobblemonOptimizer project image

    CobblemonOptimizer

    CobbleOptimizer A server-side Fabric mod for Minecraft 1.21.1 that optimizes Cobblemon (the Pokemon mod) entity performance based on server load (TPS).

    • 3.0K
    • September 13, 2026
  • Cobblemon:CrzMovesPokemon project image

    Cobblemon:CrzMovesPokemon

    ● CRZMovesPokemon This mod fixes and expands Pokemon movesets for Cobblemon 1.7 by sourcing accurate move data from Pokemon Central Wiki (the Italian Pokemon encyclopedia).

    • 1.4K
    • September 13, 2026