[PR #6328] [CLOSED] Native mods: a player starting and stopping tracking an entity #6800

Closed
opened 2026-11-03 06:26:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6328
Author: @MSedgeMC
Created: 11/1/2026
Status: ❌ Closed

Base: main ← Head: feat/md-tracking


📝 Commits (1)

  • 6cd74e1 Native mods: a player starting and stopping tracking an entity

📊 Changes

7 files changed (+244 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/lan.rs (+16 -0)
📝 crates/horizon-client/src/game/native_hooks.rs (+35 -0)
➕ crates/horizon-client/src/game/native_tracking.rs (+38 -0)
📝 crates/horizon-client/src/lan/entity.rs (+90 -2)
📝 crates/horizon-client/src/lan/hub.rs (+46 -1)
➕ tools/native-hook-fragments/player_tracking.json (+18 -0)

📄 Description

A mod must hear each entity a player starts and stops tracking, with the
player and the entity identified, as NeoForge's PlayerEvent.StartTracking
and StopTracking report them.

Horizon's hub pairs each client with the entities in its range every tick
(lan/entity.rs) and the pairing changes reached no hook, so a mod adding
per-player data to an entity had no point to send it or to drop it.

Proven: cargo test -q -p horizon-client --lib lan::entity on the build
VM: 23 passed, 0 failed (1215 filtered out), including the new
a_tracker_keeps_every_start_and_stop_in_order; and
cargo test -q -p horizon-client --bin horizon-client lan::entity compiled
the client's binary with the hook's dispatch in game/native_tracking.rs.

Not proven: not fired in a running game: no harness opens a world to the
network and counts the pairings, so the recorder and the drain are proven by
the tracker test and by compiling, not by a guest watching an entity come
into view. The window's own player sees every entity without being paired, so
it hears nothing, as the hook's doc says.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/6328 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/md-tracking` --- ### 📝 Commits (1) - [`6cd74e1`](https://github.com/horizon-rust/horizon/commit/6cd74e1d2d1d947e1346775f99bd8ce967651f1b) Native mods: a player starting and stopping tracking an entity ### 📊 Changes **7 files changed** (+244 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+16 -0) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+35 -0) ➕ `crates/horizon-client/src/game/native_tracking.rs` (+38 -0) 📝 `crates/horizon-client/src/lan/entity.rs` (+90 -2) 📝 `crates/horizon-client/src/lan/hub.rs` (+46 -1) ➕ `tools/native-hook-fragments/player_tracking.json` (+18 -0) </details> ### 📄 Description A mod must hear each entity a player starts and stops tracking, with the player and the entity identified, as NeoForge's `PlayerEvent.StartTracking` and `StopTracking` report them. Horizon's hub pairs each client with the entities in its range every tick (`lan/entity.rs`) and the pairing changes reached no hook, so a mod adding per-player data to an entity had no point to send it or to drop it. **Proven:** `cargo test -q -p horizon-client --lib lan::entity` on the build VM: 23 passed, 0 failed (1215 filtered out), including the new `a_tracker_keeps_every_start_and_stop_in_order`; and `cargo test -q -p horizon-client --bin horizon-client lan::entity` compiled the client's binary with the hook's dispatch in `game/native_tracking.rs`. **Not proven:** not fired in a running game: no harness opens a world to the network and counts the pairings, so the recorder and the drain are proven by the tracker test and by compiling, not by a guest watching an entity come into view. The window's own player sees every entity without being paired, so it hears nothing, as the hook's doc says. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:26:59 +07:00
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#6800
No description provided.