[GH-ISSUE #435] [LAN] Guest leftovers after #366: mob targeting, environmental damage, PvP, ender chest, double chests… #123

Closed
opened 2026-11-02 15:36:34 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @ludovic111 on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/435

Follow-up to #366 (fixed by #425–#430, checked by the two-client test tools/lan_e2e.py, #424). Still wrong for a LAN guest:

  • Mobs never target or attack guests.
  • Guests take no damage from lava, fire, drowning, suffocation or the void; no PvP; no hunger from moving.
  • A guest's ender chest opens the host's ender inventory.
  • Command feedback calls the guest "Player".
  • Chat shows "Replaced slot(s)" with the number missing.
  • Double chests open as 9×3.
  • Name tags aren't drawn through walls.
  • Recipe-book clicks from a guest are ignored.

Untested so far: two physical machines, and Linux (the e2e test needs vscreen there). Extend tools/lan_e2e.py with a check for each fix.

Originally created by @ludovic111 on GitHub (Oct 15, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/435 Follow-up to #366 (fixed by #425–#430, checked by the two-client test `tools/lan_e2e.py`, #424). Still wrong for a LAN guest: - Mobs never target or attack guests. - Guests take no damage from lava, fire, drowning, suffocation or the void; no PvP; no hunger from moving. - A guest's ender chest opens the host's ender inventory. - Command feedback calls the guest "Player". - Chat shows "Replaced slot(s)" with the number missing. - Double chests open as 9×3. - Name tags aren't drawn through walls. - Recipe-book clicks from a guest are ignored. Untested so far: two physical machines, and Linux (the e2e test needs vscreen there). Extend `tools/lan_e2e.py` with a check for each fix.
bsakaguchi 2026-11-02 15:36:34 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@ludovic111 commented on GitHub (Oct 16, 2026):

PRs for this issue, stacked. Merge in this order: #466 → #467 → #470 → #471 → #472 → #473 → #474. #473 is #462's LAN part.

  • #466: mobs target and attack guests.
    • Each mob sees the nearest player, as getNearestPlayer does, and keeps a guest it targets or that hurt it.
    • Hits, pushes, fire and mob projectiles run as that guest, and the knockback reaches the guest's client.
    • Also fixes the harness world. Since #407, a guest's commands need the world's Allow Commands, so every guest command in lan_e2e.py had silently failed.
  • #467: environment damage. Lava, fire, drowning, suffocation (in_wall), the void, fall damage, plus hunger from moving and jumping.
  • #470: PvP between the host and guests, with the pvp gamerule.
  • #471: containers. The guest's own ender chest, and double chests as 9×6.
  • #472: chat. Command feedback names the guest, and translated arguments show their numbers ("Replaced 1 slot(s)").
  • #474: name tags through walls. Vanilla's TEXT_SEE_THROUGH pass; this applied to every name tag, not just guests.

Each PR adds a two-client check to tools/lan_e2e.py. The checks were run with a real host and guest on the Mac mini (two offscreen clients via the control socket).

Still open: recipe-book clicks from a guest. Horizon's protocol has no ServerboundPlaceRecipePacket / ClientboundPlaceGhostRecipePacket yet, and the guest's recipe book needs the server's display ids. That needs its own PR.

Other known gaps, listed in the PR bodies:

  • Status effects on guests (guests have no effects model).
  • Who owns an arrow shot by a player.
  • Team friendly fire.
<!-- gh-comment-id:6211054940 --> @ludovic111 commented on GitHub (Oct 16, 2026): PRs for this issue, stacked. Merge in this order: #466 → #467 → #470 → #471 → #472 → #473 → #474. #473 is #462's LAN part. - **#466: mobs target and attack guests.** - Each mob sees the nearest player, as `getNearestPlayer` does, and keeps a guest it targets or that hurt it. - Hits, pushes, fire and mob projectiles run as that guest, and the knockback reaches the guest's client. - Also fixes the harness world. Since #407, a guest's commands need the world's Allow Commands, so every guest command in `lan_e2e.py` had silently failed. - **#467: environment damage.** Lava, fire, drowning, suffocation (`in_wall`), the void, fall damage, plus hunger from moving and jumping. - **#470: PvP between the host and guests**, with the `pvp` gamerule. - **#471: containers.** The guest's own ender chest, and double chests as 9×6. - **#472: chat.** Command feedback names the guest, and translated arguments show their numbers ("Replaced 1 slot(s)"). - **#474: name tags through walls.** Vanilla's `TEXT_SEE_THROUGH` pass; this applied to every name tag, not just guests. Each PR adds a two-client check to `tools/lan_e2e.py`. The checks were run with a real host and guest on the Mac mini (two offscreen clients via the control socket). **Still open:** recipe-book clicks from a guest. Horizon's protocol has no `ServerboundPlaceRecipePacket` / `ClientboundPlaceGhostRecipePacket` yet, and the guest's recipe book needs the server's display ids. That needs its own PR. Other known gaps, listed in the PR bodies: - Status effects on guests (guests have no effects model). - Who owns an arrow shot by a player. - Team friendly fire.
Author
Owner

@ludovic111 commented on GitHub (Oct 16, 2026):

Final checks on a branch combining the 7 PRs with current origin/main:

  • tools/lan_e2e.py: all 14 two-client checks pass.
  • fmt and clippy -D warnings are clean.
  • cargo test -p horizon-client -p horizon-protocol passes.
  • tools/parity.py --changed origin/main: 83 passed, 0 failed.

Fixes found along the way (details in the PR bodies):

  • #471: a guest's UseItem uses only the item. The host used to act again on the block the guest had last looked at.
  • #472: the control socket's keys now reach a server's chat input.

Still open here:

  • Recipe-book clicks from a guest. The protocol has no place-recipe packets yet.
  • After a passing UseItemOn, the host also uses the item, and the following UseItem uses it again. Example: a snowball thrown at a block flies twice. This predates this work: the host's use_hand needs splitting into its block and item halves, as vanilla's handleUseItemOn / handleUseItem are.
<!-- gh-comment-id:6213281240 --> @ludovic111 commented on GitHub (Oct 16, 2026): Final checks on a branch combining the 7 PRs with current origin/main: - `tools/lan_e2e.py`: all 14 two-client checks pass. - fmt and `clippy -D warnings` are clean. - `cargo test -p horizon-client -p horizon-protocol` passes. - `tools/parity.py --changed origin/main`: 83 passed, 0 failed. Fixes found along the way (details in the PR bodies): - #471: a guest's `UseItem` uses only the item. The host used to act again on the block the guest had last looked at. - #472: the control socket's keys now reach a server's chat input. **Still open here:** - Recipe-book clicks from a guest. The protocol has no place-recipe packets yet. - After a passing `UseItemOn`, the host also uses the item, and the following `UseItem` uses it again. Example: a snowball thrown at a block flies twice. This predates this work: the host's `use_hand` needs splitting into its block and item halves, as vanilla's `handleUseItemOn` / `handleUseItem` are.
Author
Owner

@ludovic111 commented on GitHub (Oct 21, 2026):

🤖 Agent: closing. Every item in this list was fixed by the bugs-lan-2 stack, all merged and in the stable release v2026.10.19.15:

  • #466: mobs target and attack guests.
  • #467: lava, fire, drowning, suffocation, void and fall damage, and hunger from moving.
  • #470: PvP.
  • #471: the guest's own ender chest, and double chests as 9×6.
  • #472: command feedback names the guest, and "Replaced 1 slot(s)" shows its number.
  • #473: trial spawners and vaults see guests.
  • #474 (merge b8f1011c): name tags through walls.

Each one has a two-client check in tools/lan_e2e.py. The recipe book, status effects, item use on blocks, arrow owners and team friendly fire went on to #484. All of those are fixed now except the ones still listed there: player-vs-player projectiles, a guest's kills credited to the host, and fishing bobbers. #484 stays open for those.

<!-- gh-comment-id:6313521852 --> @ludovic111 commented on GitHub (Oct 21, 2026): 🤖 Agent: closing. Every item in this list was fixed by the bugs-lan-2 stack, all merged and in the stable release v2026.10.19.15: - #466: mobs target and attack guests. - #467: lava, fire, drowning, suffocation, void and fall damage, and hunger from moving. - #470: PvP. - #471: the guest's own ender chest, and double chests as 9×6. - #472: command feedback names the guest, and "Replaced 1 slot(s)" shows its number. - #473: trial spawners and vaults see guests. - #474 (merge b8f1011c): name tags through walls. Each one has a two-client check in `tools/lan_e2e.py`. The recipe book, status effects, item use on blocks, arrow owners and team friendly fire went on to #484. All of those are fixed now except the ones still listed there: player-vs-player projectiles, a guest's kills credited to the host, and fishing bobbers. #484 stays open for those.
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#123
No description provided.