Wiki 9Minecraft Wiki 9Minecraft
Datapack Anvil Wiki › Guides › Handle Datapack Reloads and Data Refresh

Handle Datapack Reloads and Data Refresh

Understanding Reload Behavior

When /reload is executed, DataPack Anvil Mod automatically detects changes through registered Data Managers. Each manager can define custom logic for how data should be refreshed and what happens during the reload process.

Triggering a Reload

1. Modify your datapack JSON files

2. Execute /reload command on the server

3. The mod re-reads all datapack files through each Data Manager

4. Updated data is validated and loaded into memory

5. Clients automatically receive the new data

Handling Reload Events

You can configure your Data Manager to execute specific actions when reloads occur:

  • Clear old data structures before loading new ones
  • Validate data integrity after loading
  • Log what changed between reloads
  • Notify other systems that data has been refreshed

Troubleshooting Reloads

If data doesn't update after /reload, check:

  • File paths match your Data Manager's expected structure
  • JSON syntax is valid (use a JSON validator)
  • The datapack is enabled in world settings
  • Server logs for parsing errors from your Data Manager