Sync Custom Data from Server to Client
How Synchronization Works
DataPack Anvil Mod automatically handles server-to-client data synchronization through its Data Manager system. When data changes on the server, it's broadcast to all clients without manual intervention.
Triggering Synchronization
1. Modify your datapack files on the server
2. Execute /reload to trigger a datapack reload
3. The mod detects changes through your registered Data Manager
4. Updated data is automatically sent to all connected players
Accessing Synced Data on Client
Once data reaches the client, your mod can access it through the Data Manager's client-side methods. This allows client-side features like custom rendering, UI elements, or gameplay mechanics to use server-defined data without desynchronization issues.
Important Notes
Synchronization only occurs when datapacks are reloaded—changes to files won't sync automatically. Always use /reload after modifying datapack JSON files to ensure all clients receive updates.