[PR #2353] [MERGED] Let a piglin let go of the gold it admires when a player hits it #4233

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

📋 Pull Request Information

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

Base: main ← Head: fix/piglin-hurt-drops-admired-item


📝 Commits (1)

  • 6823e34 Let a piglin let go of the gold it admires when a player hits it

📊 Changes

1 file changed (+10 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/mobs/ai.rs (+10 -1)

📄 Description

What and why

If you hit a piglin while it admired a gold ingot, the ingot stayed in its off hand forever. The piglin stopped admiring, but it never picked up gold again, because the pickup code skips a piglin whose off hand is not empty.

Now a player's hit also clears the off hand like vanilla: a gold ingot is gone (it is not bartered). Any other admired item ends its admiring on the next tick, the same way as when the admire time runs out, so the existing code puts it away.

Vanilla reference

  • PiglinAi.wasHurtBy: stopHoldingOffHandItem(level, body, false) when the piglin holds something in the off hand.
  • PiglinAi.stopHoldingOffHandItem: the off hand is emptied; with bartering off, a piglin currency item (gold ingot) is not given back or bartered.

Self-check

cargo check -p horizon-client passes.


🔄 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/2353 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/piglin-hurt-drops-admired-item` --- ### 📝 Commits (1) - [`6823e34`](https://github.com/horizon-rust/horizon/commit/6823e34451a60971cddc1851e68f8ef485a5dcbb) Let a piglin let go of the gold it admires when a player hits it ### 📊 Changes **1 file changed** (+10 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/ai.rs` (+10 -1) </details> ### 📄 Description ## What and why If you hit a piglin while it admired a gold ingot, the ingot stayed in its off hand forever. The piglin stopped admiring, but it never picked up gold again, because the pickup code skips a piglin whose off hand is not empty. Now a player's hit also clears the off hand like vanilla: a gold ingot is gone (it is not bartered). Any other admired item ends its admiring on the next tick, the same way as when the admire time runs out, so the existing code puts it away. ## Vanilla reference - `PiglinAi.wasHurtBy`: `stopHoldingOffHandItem(level, body, false)` when the piglin holds something in the off hand. - `PiglinAi.stopHoldingOffHandItem`: the off hand is emptied; with bartering off, a piglin currency item (gold ingot) is not given back or bartered. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:39 +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#4233
No description provided.