[GH-ISSUE #4668] Native mods: mod messages and event hook points #1411

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

Originally created by @Qwerner88880 on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4668

Originally assigned to: @Qwerner88880 on GitHub.

🤖 Filed by Qwerner88880's AI agent (Claude Code, Claude Opus 5.5), not by Qwerner88880 personally.

Part of #3911 (Mods). Two things a native mod can't do today: a mod's server half and its client half can't exchange data, and a server mod can't hear player deaths, new mobs, kills, drops or pickups.

Proposal

One small pull request of hook points in crates/horizon-client/src/game/native_hooks.rs:

  • Mod messages: native_net_from_client, native_net_from_server, with the helpers native_net_send_to_player and native_net_send_to_server, on a new horizon:mod_net custom payload. A server announces it during configuration, and only clients with the Horizon brand get a message.
  • native_player_died: where ServerPlayer.die starts, whether death messages are shown or not.
  • native_mob_spawned: a new mob joined, and whether the world's spawning made it.
  • native_mob_killed: a player's melee blow killed a mob.
  • native_item_dropped: Player.drop.
  • native_item_picked_up: ItemEntity.playerTouch, cancellable.

Nothing changes without a native mod. NATIVE_HOOKS_API + 1, the native-hooks.json entries, and docs/native-mods.md.

Not included: right-clicking an entity (#4648), damage (reservedbytes, on #4402), particles and block breaking (merged), and sounds (#4574).

Originally created by @Qwerner88880 on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4668 Originally assigned to: @Qwerner88880 on GitHub. > 🤖 Filed by Qwerner88880's AI agent (Claude Code, Claude Opus 5.5), not by Qwerner88880 personally. Part of #3911 (Mods). Two things a native mod can't do today: a mod's server half and its client half can't exchange data, and a server mod can't hear player deaths, new mobs, kills, drops or pickups. ## Proposal One small pull request of hook points in `crates/horizon-client/src/game/native_hooks.rs`: - **Mod messages:** `native_net_from_client`, `native_net_from_server`, with the helpers `native_net_send_to_player` and `native_net_send_to_server`, on a new `horizon:mod_net` custom payload. A server announces it during configuration, and only clients with the Horizon brand get a message. - **`native_player_died`:** where `ServerPlayer.die` starts, whether death messages are shown or not. - **`native_mob_spawned`:** a new mob joined, and whether the world's spawning made it. - **`native_mob_killed`:** a player's melee blow killed a mob. - **`native_item_dropped`:** `Player.drop`. - **`native_item_picked_up`:** `ItemEntity.playerTouch`, cancellable. Nothing changes without a native mod. `NATIVE_HOOKS_API` + 1, the `native-hooks.json` entries, and `docs/native-mods.md`. Not included: right-clicking an entity (#4648), damage (reservedbytes, on #4402), particles and block breaking (merged), and sounds (#4574).
Author
Owner

@Qwerner88880 commented on GitHub (Oct 30, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6533136170 --> @Qwerner88880 commented on GitHub (Oct 30, 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#1411
No description provided.