[GH-ISSUE #7070] Pigs can cross the world border and trigger an incorrect build height message #3137

Open
opened 2026-11-03 04:06:09 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @byMehd on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7070

When riding a saddled pig with a Carrot on a Stick, the player can pass through the world border instead of being stopped.

Additionally, when riding the pig near the world border, the following message appears unexpectedly:

"The maximum build height is 319"

This happens at approximately X: 29,999,999, Y: 75, Z: 0, while simply riding the pig against the world border.

The player is only at Y = 75 and is not attempting to place any blocks, so this message should not appear.

Related issue (same world border bug with boats):
https://github.com/horizon-rust/horizon/issues/7065

Tested on:

  • OS: Windows PC
  • Horizon version: Nightly c9d474d

video :
https://github.com/user-attachments/assets/702628d5-a70e-4f09-9a91-58f3c0bb2905

Originally created by @byMehd on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7070 When riding a saddled pig with a Carrot on a Stick, the player can pass through the world border instead of being stopped. Additionally, when riding the pig near the world border, the following message appears unexpectedly: "The maximum build height is 319" This happens at approximately `X: 29,999,999, Y: 75, Z: 0`, while simply riding the pig against the world border. The player is only at Y = 75 and is not attempting to place any blocks, so this message should not appear. **Related issue (same world border bug with boats):** https://github.com/horizon-rust/horizon/issues/7065 Tested on: - OS: Windows PC - Horizon version: Nightly `c9d474d` video : https://github.com/user-attachments/assets/702628d5-a70e-4f09-9a91-58f3c0bb2905
Author
Owner

@MSedgeMC commented on GitHub (Nov 2, 2026):

Checked the message half against current main, and the handler already has vanilla's two guards: lan_actions.rs drops a UseItemOn whose block is out of the guest's interaction range (may_reach_block, ServerPlayer.isWithinBlockInteractionRange(pos, 1.0)) and one whose cursor is more than 1.0000001 from the block centre (logged, as vanilla logs it), both before the build-height check.

So "The maximum build height is 319" can only be reached by a packet the server accepted, i.e. one whose decoded block position really has y > 319 while the player is at y 75 - from a click 244 blocks above them that is nonetheless within reach, which means the position itself is wrong rather than the check. The UseItemOn position travels packed (Pos: x,z in 26 bits, y in the low 12), and 26 bits is ±33,554,431, so a vehicle that carries the player past the border to |x| > 33,554,431 would wrap the x field on the client and arrive at a different block - which is why the border half of this report matters: ServerboundUseItemOnPacket also carries a world_border flag that Horizon parses and never reads, and vanilla uses it to know the client clamped the click at the border.

Both need a client riding a pig at x ~ 30,000,000 to reproduce, which I cannot drive headlessly, so I am not guessing at a fix. What would settle it: the guest client log line for the rejected packet (its "too far away from hit block BlockPos{x=..., y=..., z=...}" warning names the exact position the client sent), which would say whether y is really above 319 and what x/z it arrived as.

<!-- gh-comment-id:6575813053 --> @MSedgeMC commented on GitHub (Nov 2, 2026): Checked the message half against current main, and the handler already has vanilla's two guards: `lan_actions.rs` drops a `UseItemOn` whose block is out of the guest's interaction range (`may_reach_block`, `ServerPlayer.isWithinBlockInteractionRange(pos, 1.0)`) and one whose cursor is more than 1.0000001 from the block centre (logged, as vanilla logs it), both before the build-height check. So "The maximum build height is 319" can only be reached by a packet the server accepted, i.e. one whose decoded block position really has `y > 319` while the player is at y 75 - from a click 244 blocks above them that is nonetheless within reach, which means the position itself is wrong rather than the check. The `UseItemOn` position travels packed (`Pos`: x,z in 26 bits, y in the low 12), and 26 bits is ±33,554,431, so a vehicle that carries the player past the border to |x| > 33,554,431 would wrap the x field on the client and arrive at a different block - which is why the border half of this report matters: `ServerboundUseItemOnPacket` also carries a `world_border` flag that Horizon parses and never reads, and vanilla uses it to know the client clamped the click at the border. Both need a client riding a pig at x ~ 30,000,000 to reproduce, which I cannot drive headlessly, so I am not guessing at a fix. What would settle it: the guest client log line for the rejected packet (its "too far away from hit block BlockPos{x=..., y=..., z=...}" warning names the exact position the client sent), which would say whether y is really above 319 and what x/z it arrived as.
Author
Owner

@Akirabane commented on GitHub (Nov 2, 2026):

🤖 Agent: Checked on current main (which has #7108, "Mobs stop at the world border").

The pig crossing the border is fixed by #7108. A saddled pig with a carrot on a stick, ridden toward +x in a flat creative world: without a border it keeps going (x = 30.2 and more); with worldborder set 10 it stops at x = 5.55 (the wall rounds to 6.0 and the pig is 0.9 wide). A pig is simulated by the server (only equines are moved by their rider), so it goes through the mob do_move that #7108 changed.

The "The maximum build height is 319" message is vanilla. ServerGamePacketListenerImpl.handleUseItemOn (26.3, javap): when mayInteract is false for a block outside the world border, it ends in sendBuildLimitMessage(true, maxY - 1), so vanilla also shows this message for any click on a block outside the border, whatever the player's height. Horizon does the same (lan_actions.rs, the else branch). The message came from the pig carrying the player past the wall (the report's x = 29,999,999 is inside the ±33,554,431 range of the packed position, so no wrap-around was involved).

Not checked: the exact action-bar text in a windowed client, and LAN or a dedicated server. If you still see a pig (or the message) go wrong on a current nightly, please share the version and the steps.

Comment by Akirabane's AI agent (Claude Code, MAX), not by Akirabane personally.

<!-- gh-comment-id:6576272626 --> @Akirabane commented on GitHub (Nov 2, 2026): 🤖 Agent: Checked on current main (which has #7108, "Mobs stop at the world border"). **The pig crossing the border is fixed by #7108.** A saddled pig with a carrot on a stick, ridden toward +x in a flat creative world: without a border it keeps going (x = 30.2 and more); with `worldborder set 10` it stops at x = 5.55 (the wall rounds to 6.0 and the pig is 0.9 wide). A pig is simulated by the server (only equines are moved by their rider), so it goes through the mob `do_move` that #7108 changed. **The "The maximum build height is 319" message is vanilla.** `ServerGamePacketListenerImpl.handleUseItemOn` (26.3, javap): when `mayInteract` is false for a block outside the world border, it ends in `sendBuildLimitMessage(true, maxY - 1)`, so vanilla also shows this message for any click on a block outside the border, whatever the player's height. Horizon does the same (`lan_actions.rs`, the `else` branch). The message came from the pig carrying the player past the wall (the report's x = 29,999,999 is inside the ±33,554,431 range of the packed position, so no wrap-around was involved). Not checked: the exact action-bar text in a windowed client, and LAN or a dedicated server. If you still see a pig (or the message) go wrong on a current nightly, please share the version and the steps. > Comment by Akirabane's AI agent (Claude Code, MAX), not by Akirabane personally.
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6578596281 --> @breachato commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
Author
Owner

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

🤖 Agent: comment by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally.

The border part looks fixed on main by #7158, "Mobs stop at the world border" (9e78d076c4, for #7080). A pig ridden with a carrot on a stick moves through Mob::do_move, which now resolves with the border's walls (resolve_in_border, Entity.collectColliders for any entity inside and close to the border). That's the same path every mob takes, so the ridden pig stops at the border too. The report's build c9d474d predates it.

The "maximum build height is 319" line most likely comes from being past the border, where a use there is answered with the wrong message. With the pig stopped at the border you shouldn't get there. If it still shows on a build with #7158, the steps would help: what's in your hand and what you're looking at.

/unclaim

<!-- gh-comment-id:6578626461 --> @breachato commented on GitHub (Nov 2, 2026): 🤖 Agent: comment by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally. The border part looks fixed on main by #7158, "Mobs stop at the world border" (9e78d076c4, for #7080). A pig ridden with a carrot on a stick moves through `Mob::do_move`, which now resolves with the border's walls (`resolve_in_border`, `Entity.collectColliders` for any entity inside and close to the border). That's the same path every mob takes, so the ridden pig stops at the border too. The report's build `c9d474d` predates it. The "maximum build height is 319" line most likely comes from being past the border, where a use there is answered with the wrong message. With the pig stopped at the border you shouldn't get there. If it still shows on a build with #7158, the steps would help: what's in your hand and what you're looking at. /unclaim
Author
Owner

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

🤖 Agent: /unclaim

<!-- gh-comment-id:6578631699 --> @breachato commented on GitHub (Nov 2, 2026): 🤖 Agent: /unclaim
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#3137
No description provided.