[GH-ISSUE #6316] Native mods: the client level hooks don't fire between two levels of the same dimension type #2051

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

Originally created by @arismoko on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6316

Originally assigned to: @breachato on GitHub.

🤖 Filed by Aria's agent swarm, Dyna, not by Aria.

native_client_level_load and native_client_level_unload (#6201) don't fire when the client moves to another level that has the same dimension type as the one it leaves.

Where, on main at 0e609939ce:

  • In enter_remote_dimension, the hooks are inside if !same (crates/horizon-client/src/game/remote.rs:2079-2088).
  • same compares the dimension type's name: r.dimension.name == dimension.name && keep_world at remote.rs:2000, where dimension is registries.dimension(spawn.dimension_type).

So a player who moves or respawns from one level into another that shares its type, for example a data pack or mod dimension using minecraft:overworld's type, fires neither hook. heard_level keeps the old dimension, and the next Unload names the wrong level.

Vanilla 26.3: ClientPacketListener.handleRespawn compares the level keys (spawn.dimension) and makes a new ClientLevel when they differ.

A possible fix: fire the hooks when spawn.dimension differs from heard_level.

Found by reading in the review of #6201. That review's in-game runs with horizon-machine-sample used only vanilla dimensions, which have different types, so it wasn't reproduced in game.

How to test: horizon-machine-sample is the recommended route. Log both client hooks, add a data pack dimension that uses minecraft:overworld's type, and teleport between it and the Overworld.

Originally created by @arismoko on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6316 Originally assigned to: @breachato on GitHub. > 🤖 Filed by Aria's agent swarm, Dyna, not by Aria. `native_client_level_load` and `native_client_level_unload` (#6201) don't fire when the client moves to another level that has the same dimension type as the one it leaves. **Where, on main at `0e609939ce`:** - In `enter_remote_dimension`, the hooks are inside `if !same` (`crates/horizon-client/src/game/remote.rs:2079-2088`). - `same` compares the dimension *type's* name: `r.dimension.name == dimension.name && keep_world` at `remote.rs:2000`, where `dimension` is `registries.dimension(spawn.dimension_type)`. So a player who moves or respawns from one level into another that shares its type, for example a data pack or mod dimension using `minecraft:overworld`'s type, fires neither hook. `heard_level` keeps the old dimension, and the next Unload names the wrong level. **Vanilla 26.3:** `ClientPacketListener.handleRespawn` compares the level keys (`spawn.dimension`) and makes a new `ClientLevel` when they differ. **A possible fix:** fire the hooks when `spawn.dimension` differs from `heard_level`. **Found by reading** in [the review of #6201](https://github.com/horizon-rust/horizon/pull/6201#pullrequestreview-5729669457). That review's in-game runs with [horizon-machine-sample](https://github.com/arismoko/horizon-machine-sample) used only vanilla dimensions, which have different types, so it wasn't reproduced in game. **How to test:** horizon-machine-sample is the recommended route. Log both client hooks, add a data pack dimension that uses `minecraft:overworld`'s type, and teleport between it and the Overworld.
Author
Owner

@breachato commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6562851775 --> @breachato commented on GitHub (Nov 1, 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#2051
No description provided.