[GH-ISSUE #4928] Phantoms can damage players through glass panes #1494

Open
opened 2026-11-02 15:47:23 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @kira-horizon[bot] on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4928

Version: Nightly 2026-10-30 · 1da354b (locally patched dedicated-server player-data persistence) · OS: Debian 13 LXC on Proxmox VE, Intel Core i5-7400T. GPU: Not applicable (headless dedicated server). (copied from the report)

What I did:

  1. Join a Minecraft Java 26.3 world on a Horizon dedicated server.
  2. Wait for phantoms to spawn at night.
  3. Stand dirctly behind glass panes with a phantom attacking nearby.
  4. Observe the phantom's attack.

What happened:
The phantom can hit and damage the player through glass panes.

What I expected:
Glass panes should prevent phantom attacks from hitting a player when the panes block the attack.

Does it happen every time?
Reproducible in my testing.

Horizon version:
Nightly 2026-10-30 · 1da354b (locally patched dedicated-server player-data persistence)

OS, CPU, GPU:
Server: Debian 13 LXC on Proxmox VE, Intel Core i5-7400T. GPU: Not applicable (headless dedicated server).

Reported on Discord by IamSanja in #horizon-bugs · Discord thread
Tags: gameplay

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @kira-horizon[bot] on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4928 **Version:** Nightly 2026-10-30 · 1da354b (locally patched dedicated-server player-data persistence) · **OS:** Debian 13 LXC on Proxmox VE, Intel Core i5-7400T. GPU: Not applicable (headless dedicated server). <sub>(copied from the report)</sub> > What I did: > > 1. Join a Minecraft Java 26.3 world on a Horizon dedicated server. > 2. Wait for phantoms to spawn at night. > 3. Stand dirctly behind glass panes with a phantom attacking nearby. > 4. Observe the phantom's attack. > > What happened: > The phantom can hit and damage the player through glass panes. > > What I expected: > Glass panes should prevent phantom attacks from hitting a player when the panes block the attack. > > Does it happen every time? > Reproducible in my testing. > > Horizon version: > Nightly 2026-10-30 · 1da354b (locally patched dedicated-server player-data persistence) > > OS, CPU, GPU: > Server: Debian 13 LXC on Proxmox VE, Intel Core i5-7400T. GPU: Not applicable (headless dedicated server). Reported on Discord by **IamSanja** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1565927287616962680) Tags: gameplay <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
Author
Owner

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

🤖 Agent:

/claim

<!-- gh-comment-id:6544078656 --> @mulareal commented on GitHub (Oct 31, 2026): 🤖 Agent: /claim
Author
Owner

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

/unclaim

<!-- gh-comment-id:6544733247 --> @mulareal commented on GitHub (Oct 31, 2026): /unclaim
Author
Owner

@github-actions[bot] commented on GitHub (Oct 31, 2026):

🤖 Claims: refused, You don't hold this issue. (asked by @mulareal)

<!-- gh-comment-id:6544735044 --> @github-actions[bot] commented on GitHub (Oct 31, 2026): 🤖 Claims: refused, You don't hold this issue. (asked by @mulareal)
Author
Owner

@kira-horizon[bot] commented on GitHub (Nov 1, 2026):

Claimed by JustKrabby on Discord (GitHub: JustKarkat), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #4928).

<!-- gh-comment-id:6551319164 --> @kira-horizon[bot] commented on GitHub (Nov 1, 2026): Claimed by `JustKrabby` on Discord (GitHub: `JustKarkat`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #4928). <!-- kira:work -->
Author
Owner

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

Investigated with the 26.3 server jar bytecode, live vanilla-server tests and two new parity tests (PR #5667). Horizon matches vanilla here, and the report's scenario is vanilla behaviour:

What vanilla 26.3 actually does (javap on the pinned server jar):

  • PhantomSweepAttackGoal.tick() bites on a plain box check — getBoundingBox().inflate(0.2).intersects(target.getBoundingBox()) → doHurtTarget — with no line-of-sight and no block test between phantom and player. The only aborts are horizontalCollision || wasHurtRecently().
  • The protection is entirely in targeting: PhantomAttackPlayerTargetGoal uses TargetingConditions' eye-to-eye ray (Sensing.hasLineOfSight), re-checked every tick in canContinueToUse via Phantom.canAttack(..., TargetingConditions.DEFAULT). A glass pane blocks that ray when it crosses the pane strip (panes aren't full cubes but the strip still clips the ray), so a phantom loses/never gets the target and never swoops.
  • PhantomSweepAttackGoal.canContinueToUse has no LOS check — once a swoop starts it finishes even if the ray gets blocked.

So panes protect only where the eye-ray is blocked. When the ray clears the panes, vanilla bites straight through them, because the bite is a box check and the boxes only need inflate(0.2) (0.2 each side) to bridge a 0.125-thick pane. Concretely, vanilla bites through panes when:

  • the player stands behind a foot-high pane wall (the eye-ray passes over the top while the boxes overlap through the pane),
  • the phantom is above the wall's top edge (its eye is clear, and its swoop presses the player's box wherever the dive ends), or
  • there are gaps between unconnected panes (the thin 0.125 post doesn't clip most rays).

"Stand directly behind glass panes" with a window-height wall, though, keeps the eye-ray blocked — the target drops the same tick and no attack happens.

Horizon (crates/horizon-client/src/mobs/phantom.rs) ports every one of these mechanisms exactly: the same inflate(0.2).intersects bite in SweepAttack::tick, the same can_attack_seen gate on targeting and can_continue, the same no-LOS sweep continue, and movement that clips against the pane's collision shape. PR #5667 adds two parity tests pinning both sides against the live geometry (player and phantom each pressed against their face of a pane, 0.125 apart):

  • a_phantom_bites_a_player_pressed_behind_a_foot_high_pane_wall — bites, as vanilla does;
  • a_phantom_cannot_target_a_player_behind_a_window_of_panes — never targets, as vanilla doesn't.

Live check on a vanilla 26.3 server: a sealed pane enclosure around the player and a 3-high pane wall with the player pressed against it — the phantom circled, never bit, health stayed 20.0 for the whole run in both geometries.

Suggested disposition: vanilla behaviour — the damage the reporter saw almost certainly came from geometry where the eye-ray clears the panes (phantom above/beside the wall top, a low wall, or pane gaps), where vanilla 26.3 bites through too. If the reporter has a seed + screenshot of the exact setup, I'm happy to re-run it; a retest on tonight's nightly with PR #5667's semantics in mind would also confirm.

<!-- gh-comment-id:6552311921 --> @JustKarkat commented on GitHub (Nov 1, 2026): Investigated with the 26.3 server jar bytecode, live vanilla-server tests and two new parity tests (PR #5667). Horizon matches vanilla here, and the report's scenario is vanilla behaviour: **What vanilla 26.3 actually does** (javap on the pinned server jar): - `PhantomSweepAttackGoal.tick()` bites on a plain box check — `getBoundingBox().inflate(0.2).intersects(target.getBoundingBox())` → `doHurtTarget` — with **no line-of-sight and no block test** between phantom and player. The only aborts are `horizontalCollision || wasHurtRecently()`. - The protection is entirely in **targeting**: `PhantomAttackPlayerTargetGoal` uses `TargetingConditions`' eye-to-eye ray (`Sensing.hasLineOfSight`), re-checked every tick in `canContinueToUse` via `Phantom.canAttack(..., TargetingConditions.DEFAULT)`. A glass **pane** blocks that ray when it crosses the pane strip (panes aren't full cubes but the strip still clips the ray), so a phantom loses/never gets the target and never swoops. - `PhantomSweepAttackGoal.canContinueToUse` has **no** LOS check — once a swoop starts it finishes even if the ray gets blocked. **So panes protect only where the eye-ray is blocked.** When the ray clears the panes, vanilla bites straight through them, because the bite is a box check and the boxes only need `inflate(0.2)` (0.2 each side) to bridge a 0.125-thick pane. Concretely, vanilla bites through panes when: - the player stands behind a **foot-high** pane wall (the eye-ray passes over the top while the boxes overlap through the pane), - the phantom is **above the wall's top edge** (its eye is clear, and its swoop presses the player's box wherever the dive ends), or - there are **gaps between unconnected panes** (the thin 0.125 post doesn't clip most rays). "Stand directly behind glass panes" with a window-height wall, though, keeps the eye-ray blocked — the target drops the same tick and no attack happens. **Horizon** (`crates/horizon-client/src/mobs/phantom.rs`) ports every one of these mechanisms exactly: the same `inflate(0.2).intersects` bite in `SweepAttack::tick`, the same `can_attack_seen` gate on targeting and `can_continue`, the same no-LOS sweep continue, and movement that clips against the pane's collision shape. PR #5667 adds two parity tests pinning both sides against the live geometry (player and phantom each pressed against their face of a pane, 0.125 apart): - `a_phantom_bites_a_player_pressed_behind_a_foot_high_pane_wall` — bites, as vanilla does; - `a_phantom_cannot_target_a_player_behind_a_window_of_panes` — never targets, as vanilla doesn't. **Live check on a vanilla 26.3 server**: a sealed pane enclosure around the player and a 3-high pane wall with the player pressed against it — the phantom circled, never bit, health stayed 20.0 for the whole run in both geometries. Suggested disposition: **vanilla behaviour** — the damage the reporter saw almost certainly came from geometry where the eye-ray clears the panes (phantom above/beside the wall top, a low wall, or pane gaps), where vanilla 26.3 bites through too. If the reporter has a seed + screenshot of the exact setup, I'm happy to re-run it; a retest on tonight's nightly with PR #5667's semantics in mind would also confirm.
Author
Owner

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

Closing as vanilla behaviour — the evidence above shows Horizon matches vanilla 26.3 on every mechanism here (bite box check, targeting LOS gate, sweep-without-LOS, pane collision), and both games protect a pane-hidden player while biting through panes wherever the eye-ray clears. Parity tests are in PR #5667; happy to reopen if a concrete seed + screenshot shows a window-height pane wall that vanilla 26.3 protects and Horizon doesn't.

<!-- gh-comment-id:6552313153 --> @JustKarkat commented on GitHub (Nov 1, 2026): Closing as vanilla behaviour — the evidence above shows Horizon matches vanilla 26.3 on every mechanism here (bite box check, targeting LOS gate, sweep-without-LOS, pane collision), and both games protect a pane-hidden player while biting through panes wherever the eye-ray clears. Parity tests are in PR #5667; happy to reopen if a concrete seed + screenshot shows a window-height pane wall that vanilla 26.3 protects and Horizon doesn't.
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#1494
No description provided.