[PR #5918] [MERGED] fix(mobs): match vanilla baby piglin equipment and gold pickups #6561

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5918
Author: @loicpiller
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/5867-piglin-bartering-offhand


📝 Commits (5)

  • efe1b71 fix(mobs): spawn baby piglins without adult equipment
  • 724ea79 fix(mobs): let baby piglins pick up and keep gold
  • 2fd0193 docs: add piglin offspring PR screenshot
  • 743a051 Merge main into the piglin branch (corpus: piglin pickups beside experience orb stuck)
  • 9beedd8 Merge main into the piglin branch (lan_e2e: piglin_offspring beside blast-projectiles)

📊 Changes

6 files changed (+159 additions, -26 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+18 -2)
📝 crates/horizon-client/src/game/piglins.rs (+42 -22)
📝 crates/horizon-client/src/mobs/render.rs (+11 -0)
➕ docs/media/piglin-offspring-after.png (+0 -0)
📝 tools/command_exec_corpus.py (+50 -0)
📝 tools/lan_e2e.py (+38 -2)

📄 Description

🤖 Opened by loicpiller's AI agent (Codex, gpt-6.1-sol), not by loicpiller personally.

What and why

Fixes #5867.

  • Baby piglins created by using a spawn egg on another piglin now start without adult spawn equipment.
  • Babies can pick up and admire gold, then keep it instead of bartering. They respect ignored_by_piglin_babies and have no preferred weapon tag; an existing loved main-hand item is preserved in their inventory when needed.
  • Offhand duplication is already fixed on main. Extend its rendering regression with the reported crossbow/gold-ingot pair.

The command fixture no longer receives the obsolete --in-frame flag. Gameplay coverage uses the integrated server and connected clients.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Read from the installed 26.3 jars using tools/rea_vanilla.py:

  • SpawnEggItem.spawnOffspringFromSpawnEgg
  • Piglin.getPreferredWeaponType, canReplaceCurrentItem, and holdInMainHand
  • PiglinAi.wantsToPickup, pickUpItem, stopHoldingOffHandItem, and holdInOffhand

Extend the existing command-execution parity harness with 31 observations covering adult barter, baby admiration and retention, occupied baby hands, and ignored leather. Add a LAN regression that uses a spawn egg from the guest and checks the same empty-handed baby on both clients.

Other projects' code

None.

Self-check

Self-check on rebased code at 2776583dc; screenshot evidence was added in 8e4e8669b. See the latest merge validation below.

pr_ready (tools/pr_ready.py --quick on mac, against origin/main at c1f4a7c19, 7 min 45 s)

Check Result
Scope ✅ 7 files, +161 −27
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (47 s)
rustfmt ✅ (9 s)
clippy ✅ (1 min 15 s)
tests: horizon-client ✅ 1678 passed (5 min 30 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 363 affected, to run in CI (--quick): ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo, basic_feature, biome_chunk and 351 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Additional validation on the rebased code:

  • python3 tools/test_command_exec_parity.py --only 'piglin pickups': 31/31 match vanilla.
  • python3 tools/lan_e2e.py --bin-dir target/fast --check piglin_offspring: pass, integrated server and two real clients.
  • python3 tools/lan_e2e.py --bin-dir target/fast --check barter: pass in isolation. A combined evidence run stalled before pickup; this isolated rerun passed.
  • python3 tools/port_ledger.py check --base origin/main: completed; the baby ignored-item drift is closed.
  • python3 tools/check_public_tree.py --history: pass.

The full harness run was stopped because this machine has no dependency history and selected 373 harnesses. The complete affected set remains for the maintainer's parity runner; it is not claimed as passing locally.

Validation after merging main (9413c1fed)

Merged main at 82f8d0a0b, retaining both the piglin and creative-shulker scenarios and all group registrations.

  • cargo build --locked --profile fast -p horizon-client --bin horizon-client --bin horizon-ctl: pass.
  • Python suite: 515 tests pass, one skipped.
  • cargo fmt --all --check, public-tree history check, and conflict-marker/index checks: pass.
  • The piglin parity run is not clean on this merge: normal runs matched 30/31 and 29/31 observations, with differences in the global item-entity count. Equipment and inventory observations matched. Temporary read-only diagnostic queries did not reproduce those extra items; the cause remains unresolved. No assertions or cases were removed.

Screenshots

Before: the reporter's baby-piglin capture in #5867.

Before: baby piglin holding a crossbow, from issue 5867

After: the baby created by the guest's spawn egg, seen on the connected client with empty hands.

After: empty-handed baby piglin

🤖 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/5918 **Author:** [@loicpiller](https://github.com/loicpiller) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/5867-piglin-bartering-offhand` --- ### 📝 Commits (5) - [`efe1b71`](https://github.com/horizon-rust/horizon/commit/efe1b716c7a87827532803b9c2230236df183d49) fix(mobs): spawn baby piglins without adult equipment - [`724ea79`](https://github.com/horizon-rust/horizon/commit/724ea7929a88a1e1600495aa4fe70de7c653107a) fix(mobs): let baby piglins pick up and keep gold - [`2fd0193`](https://github.com/horizon-rust/horizon/commit/2fd0193da5e597b47d6fc46951380e232bf4fd88) docs: add piglin offspring PR screenshot - [`743a051`](https://github.com/horizon-rust/horizon/commit/743a051f3725ffb6809815663c06d03393efd8ae) Merge main into the piglin branch (corpus: piglin pickups beside experience orb stuck) - [`9beedd8`](https://github.com/horizon-rust/horizon/commit/9beedd84632bcd6e1c5b122ce0fd1f73acc40ad2) Merge main into the piglin branch (lan_e2e: piglin_offspring beside blast-projectiles) ### 📊 Changes **6 files changed** (+159 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+18 -2) 📝 `crates/horizon-client/src/game/piglins.rs` (+42 -22) 📝 `crates/horizon-client/src/mobs/render.rs` (+11 -0) ➕ `docs/media/piglin-offspring-after.png` (+0 -0) 📝 `tools/command_exec_corpus.py` (+50 -0) 📝 `tools/lan_e2e.py` (+38 -2) </details> ### 📄 Description > 🤖 Opened by loicpiller's AI agent (Codex, gpt-6.1-sol), not by loicpiller personally. ## What and why Fixes #5867. - Baby piglins created by using a spawn egg on another piglin now start without adult spawn equipment. - Babies can pick up and admire gold, then keep it instead of bartering. They respect `ignored_by_piglin_babies` and have no preferred weapon tag; an existing loved main-hand item is preserved in their inventory when needed. - Offhand duplication is already fixed on main. Extend its rendering regression with the reported crossbow/gold-ingot pair. The command fixture no longer receives the obsolete `--in-frame` flag. Gameplay coverage uses the integrated server and connected clients. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Read from the installed 26.3 jars using `tools/rea_vanilla.py`: - `SpawnEggItem.spawnOffspringFromSpawnEgg` - `Piglin.getPreferredWeaponType`, `canReplaceCurrentItem`, and `holdInMainHand` - `PiglinAi.wantsToPickup`, `pickUpItem`, `stopHoldingOffHandItem`, and `holdInOffhand` Extend the existing command-execution parity harness with 31 observations covering adult barter, baby admiration and retention, occupied baby hands, and ignored leather. Add a LAN regression that uses a spawn egg from the guest and checks the same empty-handed baby on both clients. ## Other projects' code None. ## Self-check Self-check on rebased code at `2776583dc`; screenshot evidence was added in `8e4e8669b`. See the latest merge validation below. **pr_ready** (`tools/pr_ready.py --quick` on mac, against origin/main at c1f4a7c19, 7 min 45 s) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +161 −27 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (47 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (1 min 15 s) | | tests: horizon-client | ✅ 1678 passed (5 min 30 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 363 affected, to run in CI (--quick): ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo, basic_feature, biome_chunk and 351 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Additional validation on the rebased code: - `python3 tools/test_command_exec_parity.py --only 'piglin pickups'`: **31/31 match vanilla**. - `python3 tools/lan_e2e.py --bin-dir target/fast --check piglin_offspring`: **pass**, integrated server and two real clients. - `python3 tools/lan_e2e.py --bin-dir target/fast --check barter`: **pass** in isolation. A combined evidence run stalled before pickup; this isolated rerun passed. - `python3 tools/port_ledger.py check --base origin/main`: completed; the baby ignored-item drift is closed. - `python3 tools/check_public_tree.py --history`: **pass**. The full harness run was stopped because this machine has no dependency history and selected 373 harnesses. The complete affected set remains for the maintainer's parity runner; it is not claimed as passing locally. ### Validation after merging main (`9413c1fed`) Merged `main` at `82f8d0a0b`, retaining both the piglin and creative-shulker scenarios and all group registrations. - `cargo build --locked --profile fast -p horizon-client --bin horizon-client --bin horizon-ctl`: **pass**. - Python suite: **515 tests pass**, one skipped. - `cargo fmt --all --check`, public-tree history check, and conflict-marker/index checks: **pass**. - The piglin parity run is **not clean** on this merge: normal runs matched 30/31 and 29/31 observations, with differences in the global item-entity count. Equipment and inventory observations matched. Temporary read-only diagnostic queries did not reproduce those extra items; the cause remains unresolved. No assertions or cases were removed. ## Screenshots Before: the reporter's baby-piglin capture in #5867. <img width="420" alt="Before: baby piglin holding a crossbow, from issue 5867" src="https://github.com/user-attachments/assets/013e5638-09cf-4c8c-a121-443991042211" /> After: the baby created by the guest's spawn egg, seen on the connected client with empty hands. ![After: empty-handed baby piglin](https://raw.githubusercontent.com/loicpiller/horizon/8e4e8669bbf4a6b6b4f764768f7537818e6b213f/docs/media/piglin-offspring-after.png) 🤖 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 06:23:04 +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#6561
No description provided.