netlib
by Wanderia
netlib gives Fabric and NeoForge mods a way to send custom network packets with Kotlinx Serialization, in a Minecraft 1.21 – 1.21.1 setup.
What it does
Developers use netlib to define their own network payloads as serializable Kotlin classes, and the library encodes and decodes them into the FriendlyByteBuf or PacketByteBuf that Minecraft expects. A shared abstract base class, SerializedPayload, handles most of the work of building a new packet, so a mod author writes less boilerplate for each one.
netlib runs on both client and server, so the server and every player need it. Builds are published for Fabric and NeoForge only, for 1.21 and 1.21.1, and the latest files target 1.21.1. The code is open source under the Mozilla Public License 2.0. Required dependencies are Fabric API, Fabric Language Kotlin and Kotlin for Forge.
Key features
Kotlinx Serialization payloads
Custom payloads are declared as Kotlin classes that Kotlinx Serialization converts to and from network bytes.
Buffer encoding and decoding
The library handles the conversion between Kotlin serializers and Minecraft's FriendlyByteBuf and PacketByteBuf.
Abstract base payload
SerializedPayload provides a common base for new packets, reducing the code needed to register each one.
Example test mod
A test mod in the project shows how the payloads and serializers are used in practice.
Compatibility
Latest build for each game version and loader.
Only full game releases are shown. This mod publishes no snapshot builds.
Requirements
Dependencies declared by the latest file for each loader.
Required 2
Questions
Does netlib need Fabric API on NeoForge?
Which loaders does netlib support?
Does netlib have to be installed on the server?
In the catalog
netlib is one of 3,514 Library mods on ModsFinder, and one of 2,348 Library mods for Fabric. 32,366 mods support Minecraft 1.21.1.
Similar mods
Official listing
- Modrinth page
- modrinth.com/mod/netlib
- Owner
- Wanderia
- Published
- 2024-07-20
- Updated on Modrinth
- 2024-10-09
- Facts verified
- 2026-10-15
