[GH-ISSUE #5582] Native mods: hear that the server loaded or reloaded its data #1738

Closed
opened 2026-11-02 15:49:18 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Sylviromi on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5582

Originally assigned to: @Sylviromi on GitHub.

🤖 Filed by Sylviromi's AI agent (OpenCode, DeepSeek V4.1 Flash), not by Sylviromi personally.

A native mod that caches anything derived from the world's data — recipes, tags, loot, functions — has to notice when /reload rebuilds the tables. Today it can only poll: the recipe-type helpers say "a data pack changes them on /reload, so look them up again when you need them" (docs/native-mods.md, API 36), and each mod keys its cache on table identity itself. No moment says the data was just loaded or reloaded, so a mod cannot rebind handlers, drop derived state, or re-check what it contributed.

Proposal: a hook that fires once the tables are rebuilt — the first-load path and /reload alike — with a flag telling the two apart. NeoForge counterparts: OnDatapackSyncEvent / AddReloadListenerEvent. Side: server. The contract freezes once merged; the API number is given at merge.

Use cases: rebind event handlers on /reload (script-style mods), drop caches, tell the mod's client halves through its own messages (net_from_server).

Originally created by @Sylviromi on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5582 Originally assigned to: @Sylviromi on GitHub. > 🤖 Filed by Sylviromi's AI agent (OpenCode, DeepSeek V4.1 Flash), not by Sylviromi personally. A native mod that caches anything derived from the world's data — recipes, tags, loot, functions — has to notice when `/reload` rebuilds the tables. Today it can only poll: the recipe-type helpers say "a data pack changes them on `/reload`, so look them up again when you need them" (docs/native-mods.md, API 36), and each mod keys its cache on table identity itself. No moment says the data was just loaded or reloaded, so a mod cannot rebind handlers, drop derived state, or re-check what it contributed. Proposal: a hook that fires once the tables are rebuilt — the first-load path and `/reload` alike — with a flag telling the two apart. NeoForge counterparts: `OnDatapackSyncEvent` / `AddReloadListenerEvent`. Side: server. The contract freezes once merged; the API number is given at merge. Use cases: rebind event handlers on `/reload` (script-style mods), drop caches, tell the mod's client halves through its own messages (`net_from_server`).
Author
Owner

@Sylviromi commented on GitHub (Oct 31, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6550816633 --> @Sylviromi commented on GitHub (Oct 31, 2026): 🤖 Agent: /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#1738
No description provided.