[PR #1972] [MERGED] Shulker bullets home on the guest the shulker targets #3901

Closed
opened 2026-11-03 04:13:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1972
Author: @kacpherek
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/1493-shulker-guest-homing


📝 Commits (1)

  • 9aa6d77 Shulker bullets home on the guest the shulker targets

📊 Changes

1 file changed (+24 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+24 -0)

📄 Description

Fixes #1493.

What and why

In single player on its server thread (and for LAN guests), a shulker's bullets did not home on the
player: they flew a few steps, stopped steering and fell onto the blocks, so the player was never hurt
or levitated. In-frame single player was fine.

A mob that sees a guest keeps Who::Player as its target, and the events it aims at "the player" run
with that guest swapped in (game/lan_mobs.rs). A shulker bullet is different: it keeps its target for
its whole flight, and the projectiles tick outside that swap, where Who::Player is the host's own
player. On the server thread there is no such player, so the bullet's target lookup failed and it fell
back to the no-target branch of ShulkerBullet.tick (gravity, no homing).

When a mob that sees a guest fires a shulker bullet at Who::Player, the bullet now targets that
guest's entity id instead. The guests are already among the projectiles' targets under those ids
(lan_projectile_targets), and a hit on one already runs as that guest (lan_projectile_hit), so the
4 damage and Levitation follow unchanged.

Vanilla reference

  • Shulker.ShulkerAttackGoal.tick: new ShulkerBullet(level, shulker, target, axis) with
    Shulker.getTarget(), the targeted entity itself.
  • ShulkerBullet.finalTarget / selectNextMoveDirection / tick: homing on that entity; with no
    target, gravity of 0.04 and no steering.
  • ShulkerBullet.onHitEntity: 4 mob-projectile damage, then Levitation for 200 ticks.

Checked in game with horizon-ctl, following the issue: survival, normal difficulty, player still at
.5 100 .5, shulker summoned with NoAI at .5 100 7.5 and then given its AI back:

Path after 5 s 10 s 15 s 20 s
server thread (default) 16 HP, levitating 12 8 4 (was 20 throughout, per the issue)
--in-frame 20 16, levitating 16 12

Harnesses (no harness fires shulker bullets at a guest; these cover mob ticking and server entities):

  • test_server_entities_parity: 29 entities identical
  • test_server_player_targets_parity: 123 lines identical
  • test_mob_ai_parity: 139/141 scenarios match entirely; 55422/55662 mob-ticks match. The two
    divergences (creeper_alone tick 92, breeze_player tick 70, last-digit float differences in a look
    and a jump vector) are identical on upstream/main b7b4a261 on this Windows machine, so they are not
    from this change.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-H371RFE, against upstream/main at 6df37324f, 3 min 32 s)

Check Result
Scope Ôťů 1 files, +24 Ôłĺ0
Cargo.lock Ôťů unchanged
Public tree Ôťů
Python tests Ô׾ no Python change
rustfmt Ôťů (6 s)
clippy Ôťů (14 s)
tests: horizon-client ÔŁî 1104 passed, 3 failed (3 min 1 s)
doc tests Ôťů 0 passed (8 s)
tokens.css up to date Ô׾ theme untouched
launcher rustfmt Ô׾ launcher untouched
launcher clippy Ô׾ launcher untouched
launcher tests Ô׾ launcher untouched
Parity Ô׾ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The failing horizon-client tests above are the three that fail on Windows on upstream/main as well (crash::tests::stacks_start_at_the_panicking_frame, packs::cache::tests::directory_inputs_config_and_owned_output_recovery, save::tests::session_lock_is_exclusive); every other test passes. CI runs them on Linux.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1972 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/1493-shulker-guest-homing` --- ### 📝 Commits (1) - [`9aa6d77`](https://github.com/horizon-rust/horizon/commit/9aa6d7723fd8297a91783c7fb3b6828b8205a81c) Shulker bullets home on the guest the shulker targets ### 📊 Changes **1 file changed** (+24 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+24 -0) </details> ### 📄 Description Fixes #1493. ## What and why In single player on its server thread (and for LAN guests), a shulker's bullets did not home on the player: they flew a few steps, stopped steering and fell onto the blocks, so the player was never hurt or levitated. In-frame single player was fine. A mob that sees a guest keeps `Who::Player` as its target, and the events it aims at "the player" run with that guest swapped in (`game/lan_mobs.rs`). A shulker bullet is different: it keeps its target for its whole flight, and the projectiles tick outside that swap, where `Who::Player` is the host's own player. On the server thread there is no such player, so the bullet's target lookup failed and it fell back to the no-target branch of `ShulkerBullet.tick` (gravity, no homing). When a mob that sees a guest fires a shulker bullet at `Who::Player`, the bullet now targets that guest's entity id instead. The guests are already among the projectiles' targets under those ids (`lan_projectile_targets`), and a hit on one already runs as that guest (`lan_projectile_hit`), so the 4 damage and Levitation follow unchanged. ## Vanilla reference - `Shulker.ShulkerAttackGoal.tick`: `new ShulkerBullet(level, shulker, target, axis)` with `Shulker.getTarget()`, the targeted entity itself. - `ShulkerBullet.finalTarget` / `selectNextMoveDirection` / `tick`: homing on that entity; with no target, gravity of 0.04 and no steering. - `ShulkerBullet.onHitEntity`: 4 mob-projectile damage, then Levitation for 200 ticks. Checked in game with `horizon-ctl`, following the issue: survival, normal difficulty, player still at `.5 100 .5`, shulker summoned with `NoAI` at `.5 100 7.5` and then given its AI back: | Path | after 5 s | 10 s | 15 s | 20 s | | --- | --- | --- | --- | --- | | server thread (default) | 16 HP, levitating | 12 | 8 | 4 (was 20 throughout, per the issue) | | `--in-frame` | 20 | 16, levitating | 16 | 12 | Harnesses (no harness fires shulker bullets at a guest; these cover mob ticking and server entities): - `test_server_entities_parity`: 29 entities identical - `test_server_player_targets_parity`: 123 lines identical - `test_mob_ai_parity`: 139/141 scenarios match entirely; 55422/55662 mob-ticks match. The two divergences (`creeper_alone` tick 92, `breeze_player` tick 70, last-digit float differences in a look and a jump vector) are identical on upstream/main `b7b4a261` on this Windows machine, so they are not from this change. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-H371RFE, against upstream/main at 6df37324f, 3 min 32 s) | Check | Result | | --- | --- | | Scope | Ôťů 1 files, +24 Ôłĺ0 | | Cargo.lock | Ôťů unchanged | | Public tree | Ôťů | | Python tests | Ô׾ no Python change | | rustfmt | Ôťů (6 s) | | clippy | Ôťů (14 s) | | tests: horizon-client | ÔŁî 1104 passed, 3 failed (3 min 1 s) | | doc tests | Ôťů 0 passed (8 s) | | tokens.css up to date | Ô׾ theme untouched | | launcher rustfmt | Ô׾ launcher untouched | | launcher clippy | Ô׾ launcher untouched | | launcher tests | Ô׾ launcher untouched | | Parity | Ô׾ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The failing horizon-client tests above are the three that fail on Windows on upstream/main as well (`crash::tests::stacks_start_at_the_panicking_frame`, `packs::cache::tests::directory_inputs_config_and_owned_output_recovery`, `save::tests::session_lock_is_exclusive`); every other test passes. CI runs them on Linux. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:08 +07:00
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#3901
No description provided.