[PR #1847] [MERGED] Discard a dead player's ender pearl when the rule says so #3812

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

📋 Pull Request Information

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

Base: main ← Head: fix/1351-pearl-vanish-on-death


📝 Commits (4)

  • 0481dbd Make hardcore players spectators when they respawn
  • 10efca9 Discard a dead player's ender pearl when the rule says so
  • 50727eb Harnesses: one scaffold for one-player dedicated server scripts
  • 94bc569 Merge #1843 into #1847: share LocatorBarClient's respawn command and the harness scaffold

📊 Changes

8 files changed (+243 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game/agent.rs (+6 -2)
📝 crates/horizon-client/src/game/creatures.rs (+19 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+5 -0)
📝 crates/horizon-client/src/game/screens.rs (+22 -5)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/LocatorBarClient.java (+14 -1)
➕ tools/test_hardcore_respawn_parity.py (+49 -0)
📝 tools/test_locator_bar_parity.py (+72 -4)
➕ tools/test_pearl_death_parity.py (+56 -0)

📄 Description

What and why

Fixes #1351.

With ender_pearls_vanish_on_death on (the default), a pearl thrown just before dying kept flying. After respawning, the player was pulled back to where it landed and took 5 damage. Vanilla's ThrownEnderpearl.tick discards a pearl instead of ticking it while its owner is a dead player, so it never lands.

The projectile tick now does the same: a player's ender pearl is dropped before its tick while the rule is on and its owner is dead. The owner is the in-frame player for its own pearls, and the guest (server thread, LAN, dedicated) for theirs.

Only the rule-on case is covered here. With the rule off, the harness showed another difference: vanilla discards a pearl that lands while its owner is dead (isAllowedToTeleportOwner), but Horizon still teleports the player once they respawn. That is left for a separate change.

Vanilla reference

  • ThrownEnderpearl.tick (!owner.isAlive() && !wonGame && ENDER_PEARLS_VANISH_ON_DEATH → discard() in place of super.tick())
  • ThrownEnderpearl.findOwnerIncludingDeadPlayer

New harness tools/test_pearl_death_parity.py: a vanilla dedicated server and Horizon's each serve the same flat world. A LocatorBarClient player throws a pearl straight up (new use NAME PITCH command, ServerboundUseItemPacket), runs /kill @s while it flies, then sends PERFORM_RESPAWN (new respawn NAME command) and waits for the pearl to come down. The teleports, game mode changes and respawns after the throw are compared exactly. Passes with the fix. With the rule off, which has the same effect as the unfixed code, Horizon sent an extra teleport after the respawn and vanilla sent none, so the comparison fails on the old behaviour.

Ran: python3 tools/parity.py pearl_death. parity.py --changed origin/main selects nearly every harness for a horizon-client change, so I only ran this one. The build (cargo blaze build -p horizon-client) is clean.

Self-check

pr_ready (tools/pr_ready.py --quick on device-591, against origin/main at bd591f985, 3 min 12 s)

Check Result
Scope ✅ 3 files, +175 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 267 passed (27 s)
rustfmt ✅ (5 s)
clippy ✅ (4 s)
tests: horizon-client ✅ 1236 passed (2 min 32 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 320 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, bamboo, basic_feature and 308 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🔄 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/1847 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/1351-pearl-vanish-on-death` --- ### 📝 Commits (4) - [`0481dbd`](https://github.com/horizon-rust/horizon/commit/0481dbdb81e49134f42dccafb58474504466a440) Make hardcore players spectators when they respawn - [`10efca9`](https://github.com/horizon-rust/horizon/commit/10efca9e6cd922ff7b9a4a3cc3f5a467e97f52f2) Discard a dead player's ender pearl when the rule says so - [`50727eb`](https://github.com/horizon-rust/horizon/commit/50727eb5c3d389628549c9237bbcca76029c3b79) Harnesses: one scaffold for one-player dedicated server scripts - [`94bc569`](https://github.com/horizon-rust/horizon/commit/94bc569a7fb518fb8c56538c3c774edf0e20b71c) Merge #1843 into #1847: share LocatorBarClient's respawn command and the harness scaffold ### 📊 Changes **8 files changed** (+243 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/agent.rs` (+6 -2) 📝 `crates/horizon-client/src/game/creatures.rs` (+19 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+5 -0) 📝 `crates/horizon-client/src/game/screens.rs` (+22 -5) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/LocatorBarClient.java` (+14 -1) ➕ `tools/test_hardcore_respawn_parity.py` (+49 -0) 📝 `tools/test_locator_bar_parity.py` (+72 -4) ➕ `tools/test_pearl_death_parity.py` (+56 -0) </details> ### 📄 Description ## What and why Fixes #1351. With `ender_pearls_vanish_on_death` on (the default), a pearl thrown just before dying kept flying. After respawning, the player was pulled back to where it landed and took 5 damage. Vanilla's `ThrownEnderpearl.tick` discards a pearl instead of ticking it while its owner is a dead player, so it never lands. The projectile tick now does the same: a player's ender pearl is dropped before its tick while the rule is on and its owner is dead. The owner is the in-frame player for its own pearls, and the guest (server thread, LAN, dedicated) for theirs. Only the rule-on case is covered here. With the rule off, the harness showed another difference: vanilla discards a pearl that lands while its owner is dead (`isAllowedToTeleportOwner`), but Horizon still teleports the player once they respawn. That is left for a separate change. ## Vanilla reference - `ThrownEnderpearl.tick` (`!owner.isAlive() && !wonGame && ENDER_PEARLS_VANISH_ON_DEATH` → `discard()` in place of `super.tick()`) - `ThrownEnderpearl.findOwnerIncludingDeadPlayer` New harness `tools/test_pearl_death_parity.py`: a vanilla dedicated server and Horizon's each serve the same flat world. A LocatorBarClient player throws a pearl straight up (new `use NAME PITCH` command, ServerboundUseItemPacket), runs `/kill @s` while it flies, then sends PERFORM_RESPAWN (new `respawn NAME` command) and waits for the pearl to come down. The teleports, game mode changes and respawns after the throw are compared exactly. Passes with the fix. With the rule off, which has the same effect as the unfixed code, Horizon sent an extra teleport after the respawn and vanilla sent none, so the comparison fails on the old behaviour. Ran: `python3 tools/parity.py pearl_death`. `parity.py --changed origin/main` selects nearly every harness for a horizon-client change, so I only ran this one. The build (`cargo blaze build -p horizon-client`) is clean. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on device-591, against origin/main at bd591f985, 3 min 12 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +175 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 267 passed (27 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (4 s) | | tests: horizon-client | ✅ 1236 passed (2 min 32 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 320 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, bamboo, basic_feature and 308 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:29 +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#3812
No description provided.