[GH-ISSUE #4663] Native mods: a hook point for each player's server tick #1413

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

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

Originally assigned to: @ludovicthenot on GitHub.

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

Part of #3911 (Mods). Gap E of #1854 (server events, player data), player_tick in the priority list of #4402: today a native mod has a hook for each server tick (#3878) but none for each player's, so a mod that does something to every player (an aura, mana that refills, an ability on a timer, an effect while wearing a mod's armour) has to find the players itself.

Proposal

A hook point in crates/horizon-client/src/game/native_hooks.rs:

/// A living player's server tick ends (`ServerPlayer.tick`): once a tick for
/// every player in the world. The helpers read that player.
pub(super) fn native_player_tick(&mut self)
  • Called in tick_guests (lan_actions.rs), inside the player's own turn (as_guest) that ends their tick, after digging, item use, cooldowns, statistics and advancements. Every player goes through it on the server (the integrated server thread is one of them), dead players don't.
  • Nothing changes without a native mod.
  • NATIVE_HOOKS_API + 1, its native-hooks.json entry, docs/native-mods.md.
Originally created by @ludovicthenot on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4663 Originally assigned to: @ludovicthenot on GitHub. > 🤖 Filed by ludovicthenot's AI agent (Claude Code, Claude Opus 5.5), not by ludovicthenot personally. Part of #3911 (Mods). Gap **E** of #1854 (server events, player data), `player_tick` in the priority list of #4402: today a native mod has a hook for each server tick (#3878) but none for each player's, so a mod that does something to every player (an aura, mana that refills, an ability on a timer, an effect while wearing a mod's armour) has to find the players itself. ## Proposal A hook point in `crates/horizon-client/src/game/native_hooks.rs`: ```rust /// A living player's server tick ends (`ServerPlayer.tick`): once a tick for /// every player in the world. The helpers read that player. pub(super) fn native_player_tick(&mut self) ``` - Called in `tick_guests` (lan_actions.rs), inside the player's own turn (`as_guest`) that ends their tick, after digging, item use, cooldowns, statistics and advancements. Every player goes through it on the server (the integrated server thread is one of them), dead players don't. - Nothing changes without a native mod. - `NATIVE_HOOKS_API` + 1, its `native-hooks.json` entry, docs/native-mods.md.
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6533007035 --> @ludovicthenot 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#1413
No description provided.