[PR #6547] [MERGED] Native mods: a player teleported by a command (native_player_teleported, part of #5816) #6943

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6547
Author: @Detimes
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: feat-player-teleported-hook


📝 Commits (10+)

  • 8a65c97 Merge the profiles prerequisite onto current main for Setup
  • d48b592 Splitscreen: arrange players with a Setup map and Apply/Revert
  • fb0496a Align Setup pause icons and seed the saved switch in live checks
  • 69ce6f6 Merge current main into the Setup rebuild
  • ab3ebbd Native mods: a player swapping their hands, cancellable (native_player_swap_hands)
  • 4e70c05 Native mods: a player's food level changing, changeable (native_food_level_changed)
  • 8ac0773 Keep native mouse ownership when a second local player joins
  • a5da7ab Keep the native mouse regression fixture portable across filesystem paths
  • adea816 Merge current main into the Setup draft before localization fixes
  • b3dcefa Localize the splitscreen Setup screen and its window feedback

📊 Changes

75 files changed (+10142 additions, -1954 deletions)

View changed files

📝 crates/horizon-client-render/src/chunk.rs (+12 -6)
📝 crates/horizon-client-render/src/lib.rs (+2 -0)
📝 crates/horizon-client-render/src/mesher.rs (+65 -20)
📝 crates/horizon-client-render/src/mesher/reuse_tests.rs (+60 -1)
📝 crates/horizon-client-render/src/mesher/sides.rs (+5 -4)
➕ crates/horizon-client-render/src/mesher/tint_tests.rs (+114 -0)
📝 crates/horizon-client-render/src/options_ui.rs (+32 -12)
📝 crates/horizon-client-render/src/split_layout.rs (+487 -25)
➕ crates/horizon-client-render/src/split_map.rs (+166 -0)
➕ crates/horizon-client-render/src/split_ui.rs (+716 -0)
📝 crates/horizon-client/assets/horizon/lang/en_us.json (+31 -2)
📝 crates/horizon-client/assets/horizon/lang/fr_fr.json (+35 -6)
📝 crates/horizon-client/src/benchmark.rs (+90 -1)
📝 crates/horizon-client/src/breathing.rs (+1 -1)
📝 crates/horizon-client/src/client_lib.rs (+4 -3)
📝 crates/horizon-client/src/crafting.rs (+1 -1)
📝 crates/horizon-client/src/entry.rs (+47 -0)
📝 crates/horizon-client/src/game.rs (+25 -6)
📝 crates/horizon-client/src/game/agent.rs (+9 -2)
📝 crates/horizon-client/src/game/commands.rs (+22 -0)

...and 55 more files

📄 Description

🤖 Opened by Detimes' AI agent (Claude Code, Claude Sonnet 5.5), not by Detimes personally.

What and why

Part of #5816 (hook points a survival server's native mods need). A mod could not hear a player being teleported, inside a level or across levels.

  • New hook point native_player_teleported(player, name, from, to, dimension) (fragment native_player_teleported.json with neoforge: EntityTeleportEvent, docs paragraph). In-level /tp queues a TeleportNote (commands.rs), fired at the end of leave_guest through as_guest; across levels it fires from run_level_teleports once the new level is entered. The player's state is swapped in.
  • Nothing changes when no mod hooks it.

Kind

  • feature (new native hook point)

Vanilla reference

Entity.teleportTo; NeoForge: EntityTeleportEvent.

Other projects' code

none. (Tested with a throwaway horizon-mixins bundle, not part of this PR.)

Proof on a real dedicated server

Engine from the batch branch this commit comes from, plus a throwaway bundle.

/tp inside the overworld                    -> hook: from=[0.5,100,0.5] to=[20.5,100,20.5] dimension=minecraft:overworld, acting=Some(player), native_tell sent=true
/tp into the nether                         -> from=[20.5,100,20.5] to=[0.5,100,0.5] dimension=minecraft:the_nether
control: console say (no teleport)          -> 0 hook lines

Not covered: ender pearls, chorus fruit and spectator teleports (named in the doc comment); portals and respawns are not teleports here.

Self-check

pr_ready --quick --base upstream/main ran once on the whole branch that carries this and four other hook commits (16 files, +396 −9): Python tests 586 passed, rustfmt, clippy, horizon-client tests 1806 passed, doc tests pass; parity not run (--quick). This PR is that commit cherry-picked onto current main (7 files changed, 116 insertions(+), 1 deletion(-)): cargo test -p horizon-client native_hooks passes (21 passed).


🔄 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/6547 **Author:** [@Detimes](https://github.com/Detimes) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat-player-teleported-hook` --- ### 📝 Commits (10+) - [`8a65c97`](https://github.com/horizon-rust/horizon/commit/8a65c97f3b2ee6a1f2536db6faa2bedbca5f62a8) Merge the profiles prerequisite onto current main for Setup - [`d48b592`](https://github.com/horizon-rust/horizon/commit/d48b592ddde908a6ccba643cc27d1411bbdebd95) Splitscreen: arrange players with a Setup map and Apply/Revert - [`fb0496a`](https://github.com/horizon-rust/horizon/commit/fb0496a105f785cfb7e9165d3c228935161e9a6f) Align Setup pause icons and seed the saved switch in live checks - [`69ce6f6`](https://github.com/horizon-rust/horizon/commit/69ce6f6c2635ceb282e0d8ea9dfc0bf2197286d0) Merge current main into the Setup rebuild - [`ab3ebbd`](https://github.com/horizon-rust/horizon/commit/ab3ebbdd653d3348ff6e56460eabff0493dcbfd9) Native mods: a player swapping their hands, cancellable (native_player_swap_hands) - [`4e70c05`](https://github.com/horizon-rust/horizon/commit/4e70c0549732dedd1ab50f4004b18b10984714a4) Native mods: a player's food level changing, changeable (native_food_level_changed) - [`8ac0773`](https://github.com/horizon-rust/horizon/commit/8ac07733050b65418c83772146e6e6bc3f7eda85) Keep native mouse ownership when a second local player joins - [`a5da7ab`](https://github.com/horizon-rust/horizon/commit/a5da7abce2db7a399dd3d8cfe004284f77f344ed) Keep the native mouse regression fixture portable across filesystem paths - [`adea816`](https://github.com/horizon-rust/horizon/commit/adea816573d33afa17d8843006bec63c23c8e828) Merge current main into the Setup draft before localization fixes - [`b3dcefa`](https://github.com/horizon-rust/horizon/commit/b3dcefa2ac3f6c02e06d45b165c0bc1252a9d01f) Localize the splitscreen Setup screen and its window feedback ### 📊 Changes **75 files changed** (+10142 additions, -1954 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/chunk.rs` (+12 -6) 📝 `crates/horizon-client-render/src/lib.rs` (+2 -0) 📝 `crates/horizon-client-render/src/mesher.rs` (+65 -20) 📝 `crates/horizon-client-render/src/mesher/reuse_tests.rs` (+60 -1) 📝 `crates/horizon-client-render/src/mesher/sides.rs` (+5 -4) ➕ `crates/horizon-client-render/src/mesher/tint_tests.rs` (+114 -0) 📝 `crates/horizon-client-render/src/options_ui.rs` (+32 -12) 📝 `crates/horizon-client-render/src/split_layout.rs` (+487 -25) ➕ `crates/horizon-client-render/src/split_map.rs` (+166 -0) ➕ `crates/horizon-client-render/src/split_ui.rs` (+716 -0) 📝 `crates/horizon-client/assets/horizon/lang/en_us.json` (+31 -2) 📝 `crates/horizon-client/assets/horizon/lang/fr_fr.json` (+35 -6) 📝 `crates/horizon-client/src/benchmark.rs` (+90 -1) 📝 `crates/horizon-client/src/breathing.rs` (+1 -1) 📝 `crates/horizon-client/src/client_lib.rs` (+4 -3) 📝 `crates/horizon-client/src/crafting.rs` (+1 -1) 📝 `crates/horizon-client/src/entry.rs` (+47 -0) 📝 `crates/horizon-client/src/game.rs` (+25 -6) 📝 `crates/horizon-client/src/game/agent.rs` (+9 -2) 📝 `crates/horizon-client/src/game/commands.rs` (+22 -0) _...and 55 more files_ </details> ### 📄 Description > 🤖 Opened by Detimes' AI agent (Claude Code, Claude Sonnet 5.5), not by Detimes personally. ## What and why Part of #5816 (hook points a survival server's native mods need). A mod could not hear a player being teleported, inside a level or across levels. - New hook point `native_player_teleported(player, name, from, to, dimension)` (fragment `native_player_teleported.json` with `neoforge: EntityTeleportEvent`, docs paragraph). In-level `/tp` queues a `TeleportNote` (`commands.rs`), fired at the end of `leave_guest` through `as_guest`; across levels it fires from `run_level_teleports` once the new level is entered. The player's state is swapped in. - Nothing changes when no mod hooks it. ## Kind - [x] feature (new native hook point) ## Vanilla reference `Entity.teleportTo`; NeoForge: `EntityTeleportEvent`. ## Other projects' code none. (Tested with a throwaway horizon-mixins bundle, not part of this PR.) ## Proof on a real dedicated server Engine from the batch branch this commit comes from, plus a throwaway bundle. ``` /tp inside the overworld -> hook: from=[0.5,100,0.5] to=[20.5,100,20.5] dimension=minecraft:overworld, acting=Some(player), native_tell sent=true /tp into the nether -> from=[20.5,100,20.5] to=[0.5,100,0.5] dimension=minecraft:the_nether control: console say (no teleport) -> 0 hook lines ``` Not covered: ender pearls, chorus fruit and spectator teleports (named in the doc comment); portals and respawns are not teleports here. ## Self-check `pr_ready --quick --base upstream/main` ran once on the whole branch that carries this and four other hook commits (16 files, +396 −9): Python tests 586 passed, rustfmt, clippy, `horizon-client` tests 1806 passed, doc tests pass; parity not run (`--quick`). This PR is that commit cherry-picked onto current main (7 files changed, 116 insertions(+), 1 deletion(-)): `cargo test -p horizon-client native_hooks` passes (21 passed). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:29:58 +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#6943
No description provided.