[PR #1954] [MERGED] Fix lead drops when leashed mobs die #3888

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

📋 Pull Request Information

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

Base: main ← Head: rdbt/fix-1949-leash-death


📝 Commits (1)

  • 0b49da2 Fix lead drops when leashed mobs die

📊 Changes

5 files changed (+49 additions, -1 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+16 -0)
📝 crates/horizon-client/src/game/leads.rs (+2 -0)
📝 crates/horizon-client/src/mobs/leash.rs (+9 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaMobAiOracle.java (+8 -0)
📝 tools/test_mob_ai_parity.py (+14 -1)

📄 Description

🤖 Opened by rdbt's AI agent (Codex), not by rdbt himself.

What and why

Fixes #1949. Dying leashed mobs now detach their lead and drop it as an item instead of retaining it through the corpse animation and losing it on removal. Death drops respect entity_drops.

The shared mob tick emits the existing leash-break event, handled by the same game code for in-frame play and integrated/dedicated servers.

Vanilla reference

Followed pinned 26.3 Leashable.tickLeash and Entity.canInteractWithLevel, inspected with tools/rea_vanilla.py: a dying entity cannot interact with the level, so its lead is removed, with an item drop when entity_drops is enabled.

Extended mob_ai parity coverage with trader-held and player-held dying llamas. The oracle and probe compare leash state and lead item counts over ten ticks to catch missing or repeated drops. Parity execution is left to CI as requested.

Self-check

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at e05933169, 4 min 51 s)

Check Result
Scope ✅ 5 files, +49 −1
Cargo.lock ✅ unchanged
Public tree ✅ (2 s)
Python tests ✅ 287 passed (43 s)
rustfmt ✅ (25 s)
clippy ✅ (7 s)
tests: horizon-client ✅ 1255 passed (3 min 3 s)
doc tests ✅ 0 passed (6 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 109 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_transformer, breaking_model, camera and 97 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Validation used fresh temporary HORIZON_HOME, HORIZON_LAUNCHER_HOME, XDG_DATA_HOME, and XDG_CONFIG_HOME, with self-update and audio disabled. An earlier run hit the existing horizon-ctl test's default-home No AI setting; the isolated targeted rerun and full self-check passed. Harness trace parsing and git diff --check also passed.

🤖 Generated with Codex.


🔄 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/1954 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `rdbt/fix-1949-leash-death` --- ### 📝 Commits (1) - [`0b49da2`](https://github.com/horizon-rust/horizon/commit/0b49da246674bef76848ffe3ecb7517db48f0faf) Fix lead drops when leashed mobs die ### 📊 Changes **5 files changed** (+49 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+16 -0) 📝 `crates/horizon-client/src/game/leads.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/leash.rs` (+9 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaMobAiOracle.java` (+8 -0) 📝 `tools/test_mob_ai_parity.py` (+14 -1) </details> ### 📄 Description > 🤖 Opened by rdbt's AI agent (Codex), not by rdbt himself. ## What and why Fixes #1949. Dying leashed mobs now detach their lead and drop it as an item instead of retaining it through the corpse animation and losing it on removal. Death drops respect `entity_drops`. The shared mob tick emits the existing leash-break event, handled by the same game code for in-frame play and integrated/dedicated servers. ## Vanilla reference Followed pinned 26.3 `Leashable.tickLeash` and `Entity.canInteractWithLevel`, inspected with `tools/rea_vanilla.py`: a dying entity cannot interact with the level, so its lead is removed, with an item drop when `entity_drops` is enabled. Extended `mob_ai` parity coverage with trader-held and player-held dying llamas. The oracle and probe compare leash state and lead item counts over ten ticks to catch missing or repeated drops. Parity execution is left to CI as requested. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at e05933169, 4 min 51 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +49 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (2 s) | | Python tests | ✅ 287 passed (43 s) | | rustfmt | ✅ (25 s) | | clippy | ✅ (7 s) | | tests: horizon-client | ✅ 1255 passed (3 min 3 s) | | doc tests | ✅ 0 passed (6 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 109 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_transformer, breaking_model, camera and 97 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Validation used fresh temporary `HORIZON_HOME`, `HORIZON_LAUNCHER_HOME`, `XDG_DATA_HOME`, and `XDG_CONFIG_HOME`, with self-update and audio disabled. An earlier run hit the existing `horizon-ctl` test's default-home No AI setting; the isolated targeted rerun and full self-check passed. Harness trace parsing and `git diff --check` also passed. 🤖 Generated with [Codex](https://openai.com/codex/). --- <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:02 +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#3888
No description provided.