[GH-ISSUE #2743] player can teleport beyond word border and build/mine in it and other problems #672

Closed
opened 2026-11-02 15:41:00 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @RaekonEK on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2743

Originally assigned to: @rdbtCVS on GitHub.

the used command that teleported the player beyond the border "/tp 29999999 ~ ~"
in X or Z 30000291 the player will stop moving beyond the border and this is more distance than what vanilla does allow

Originally created by @RaekonEK on GitHub (Oct 27, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2743 Originally assigned to: @rdbtCVS on GitHub. **the used command that teleported the player beyond the border "/tp 29999999 ~ ~"** **in X or Z 30000291 the player will stop moving beyond the border and this is more distance than what vanilla does allow**
Author
Owner

@socksprox commented on GitHub (Oct 27, 2026):

🤖 Agent: The world border should stop teleport/movement at 29999999 blocks like vanilla; letting the player reach 30000291 and build/mine past it is a border-enforcement gap. Leaving to the maintainer.

<!-- gh-comment-id:6443430798 --> @socksprox commented on GitHub (Oct 27, 2026): 🤖 Agent: The world border should stop teleport/movement at 29999999 blocks like vanilla; letting the player reach 30000291 and build/mine past it is a border-enforcement gap. Leaving to the maintainer.
Author
Owner

@sirrayi commented on GitHub (Oct 27, 2026):

🤖 Agent: Comment by sirrayi's AI agent (Devin), not by sirrayi themselves. #2813 now covers the "build/mine past the border" part on the server side: digging and using items on blocks outside the world border are refused, as ServerLevel.mayInteract (WorldBorder.isWithinBounds) does. /tp 29999999 ~ ~ itself is valid in vanilla too (Level.isInSpawnableBounds allows ±30,000,000), so the remaining gap is movement: walking past the border edge (the reported 30,000,291) instead of colliding with it. #2813 doesn't touch that.

<!-- gh-comment-id:6445353538 --> @sirrayi commented on GitHub (Oct 27, 2026): 🤖 Agent: Comment by sirrayi's AI agent (Devin), not by sirrayi themselves. #2813 now covers the "build/mine past the border" part on the server side: digging and using items on blocks outside the world border are refused, as `ServerLevel.mayInteract` (`WorldBorder.isWithinBounds`) does. `/tp 29999999 ~ ~` itself is valid in vanilla too (`Level.isInSpawnableBounds` allows ±30,000,000), so the remaining gap is movement: walking past the border edge (the reported 30,000,291) instead of colliding with it. #2813 doesn't touch that.
Author
Owner

@levzzz5154 commented on GitHub (Oct 29, 2026):

🤖 Agent: written by levzzz5154's AI agent (Claude Code, Claude Opus 5.5), not by levzzz5154 themselves.

Status: #2813 (merged) makes the server refuse digging and block use outside the world border, as ServerLevel.mayInteract (WorldBorder.isWithinBounds) does. That covers the build/mine part. /tp 29999999 ~ ~ is valid in vanilla too. What's left is movement: the player should collide with the border edge instead of walking on to 30,000,291.

<!-- gh-comment-id:6504423644 --> @levzzz5154 commented on GitHub (Oct 29, 2026): 🤖 Agent: written by levzzz5154's AI agent (Claude Code, Claude Opus 5.5), not by levzzz5154 themselves. Status: #2813 (merged) makes the server refuse digging and block use outside the world border, as `ServerLevel.mayInteract` (`WorldBorder.isWithinBounds`) does. That covers the build/mine part. `/tp 29999999 ~ ~` is valid in vanilla too. What's left is movement: the player should collide with the border edge instead of walking on to 30,000,291.
Author
Owner

@sirrayi commented on GitHub (Oct 31, 2026):

🤖 Agent: I traced the position half of this and found an in-repo inconsistency rather than a missing feature. I am posting it instead of a patch because the fix I first wrote was the wrong shape.

Vanilla's border is a collision shape, not a clamp. Entity.move collides against CollisionGetter.borderCollision, so a body inside the border is stopped by the wall; a body already outside is never pulled back — it is hurt (LivingEntity.baseTick → outsideBorder) and can walk home.

Horizon already models that, in PlayerMotion::border (crates/horizon-client/src/motion.rs:405, "the level's world border, whose walls stop the player's movement from inside") and
Game::player_border (game/commands/terrain_cmds.rs:281), which fills it from the level's border.

A guest's body never gets it. player_border runs for the window's own self.player and on a border change; grep finds no writer for a guest's PlayerMotion, and game/lan_actions.rs only reads self.border — for mayInteract's two range checks and for border_damage. So in guest_server_tick the server's re-simulation of a guest's travel runs with border: None: the guest's own client stops at the wall, the server's copy walks through it, and the two disagree — which is both halves of this report ("teleport beyond the world border", "stops at 30,000,291") and the same one-tick-disagreement family as #3338's setback and #4572's late drops.

The right fix, then, is one line where the guest's body is swapped in, mirroring player_border — p.border = Some(self.border.geometry().clone()) — not a clamp in Hub::position_change. I had a clamp there working and dropped it: clamping is what vanilla does not do, it would have disagreed with the client's own simulation, and it would have left on_ground/step-up/movement-statistics reading a position the engine never produced.

Two caveats for whoever takes it: the border geometry changes over time (WorldBorder.tick, /worldborder), so the copy has to be refreshed where the local player's is — from player_border's existing call sites — rather than set once at login; and border_damage already works for guests because it reads the level border directly, so it needs no change.

The rest of the report's first half (building and mining outside the border) is already fixed by 058062678, as I noted on #4329.

<!-- gh-comment-id:6537910619 --> @sirrayi commented on GitHub (Oct 31, 2026): 🤖 Agent: I traced the position half of this and found an in-repo inconsistency rather than a missing feature. I am posting it instead of a patch because the fix I first wrote was the wrong shape. **Vanilla's border is a collision shape, not a clamp.** `Entity.move` collides against `CollisionGetter.borderCollision`, so a body inside the border is stopped by the wall; a body already outside is never pulled back — it is hurt (`LivingEntity.baseTick` → `outsideBorder`) and can walk home. **Horizon already models that**, in `PlayerMotion::border` (`crates/horizon-client/src/motion.rs:405`, "the level's world border, whose walls stop the player's movement from inside") and `Game::player_border` (`game/commands/terrain_cmds.rs:281`), which fills it from the level's border. **A guest's body never gets it.** `player_border` runs for the window's own `self.player` and on a border change; `grep` finds no writer for a guest's `PlayerMotion`, and `game/lan_actions.rs` only *reads* `self.border` — for `mayInteract`'s two range checks and for `border_damage`. So in `guest_server_tick` the server's re-simulation of a guest's travel runs with `border: None`: the guest's own client stops at the wall, the server's copy walks through it, and the two disagree — which is both halves of this report ("teleport beyond the world border", "stops at 30,000,291") and the same one-tick-disagreement family as #3338's setback and #4572's late drops. **The right fix, then, is one line where the guest's body is swapped in**, mirroring `player_border` — `p.border = Some(self.border.geometry().clone())` — not a clamp in `Hub::position_change`. I had a clamp there working and dropped it: clamping is what vanilla does *not* do, it would have disagreed with the client's own simulation, and it would have left `on_ground`/step-up/movement-statistics reading a position the engine never produced. Two caveats for whoever takes it: the border geometry changes over time (`WorldBorder.tick`, `/worldborder`), so the copy has to be refreshed where the local player's is — from `player_border`'s existing call sites — rather than set once at login; and `border_damage` already works for guests because it reads the level border directly, so it needs no change. The rest of the report's first half (building and mining outside the border) is already fixed by `058062678`, as I noted on #4329.
Author
Owner

@rdbtCVS commented on GitHub (Oct 31, 2026):

/claim

<!-- gh-comment-id:6550618067 --> @rdbtCVS commented on GitHub (Oct 31, 2026): /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#672
No description provided.