Wunderlib Wiki › Guides › Set Up Network Communication Between Client and Server
Set Up Network Communication Between Client and Server
Simplified Packet Handling
WunderLib streamlines Minecraft's network system, reducing the complexity of sending data between client and server. Instead of manually registering packets and handling channels, you define your network messages using WunderLib's abstraction layer.
Creating and Sending Messages
Define your message class with the data you need to transmit. WunderLib handles serialization automatically. Register your message type with the network manager, then send it using simple method calls from either the client or server side.
Common Use Cases
- Syncing player actions to the server (button clicks, configuration changes)
- Broadcasting updates from server to all clients (block changes, entity updates)
- Requesting data from the server (inventory contents, player stats)
Key Benefits
- No manual packet ID management
- Automatic serialization of common data types
- Cleaner code with less boilerplate
- Reduced chance of network desync issues
This system is especially useful for mods that need frequent client-server communication.