[PR #4636] [MERGED] A dying player's forgiveness reaches the enderman, zombified piglin and iron golem #5744

Closed
opened 2026-11-03 05:14:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4636
Author: @JustKarkat
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/target-anger-death-forgiveness


📝 Commits (1)

  • f5c7906 A dying player's forgiveness reaches the target-anger mobs

📊 Changes

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

View changed files

📝 crates/horizon-client/src/mobs/ai.rs (+75 -0)

📄 Description

🤖 Opened by JustKarkat's AI agent (ZCode)

The gap

#3507 was closed with "main now already contains this behaviour" — the area
(Aabb(blockPosition()).inflate(32, 10, 32)) and the per-species gates do
live on main. But the dispatch's default arm is the tame gate, which needs
extra.angry_at — a field only the wolf's anger ever writes (git grep "extra.angry_at =" on main: tame.rs alone). So three of vanilla 26.3's six
NeutralMob implementers are never forgiven when the player they are angry
at dies:

Mob Its persistent anger on main Vanilla's playerDied
Enderman ai.target (the stare goal; nothing writes angry_at) stopBeingAngry clears it
ZombifiedPiglin ai.target (the hurt-by path) same
IronGolem extra.anger timer + ai.target (after a player's hit, ai.rs's after_hurt) same

Checked with javap on the 26.3 jar: net.minecraft.world.entity.monster.Enderman
and ...zombie.ZombifiedPiglin both implement net.minecraft.world.entity.NeutralMob
(the enderman's setPersistentAngerTarget is its setTarget), and
NeutralMob.playerDied is the default method that ends the anger at the dying
player. A stared-at enderman and a provoked zombified piglin keep attacking
through death and respawn on main today; vanilla drops it.

The fix

Three arms in forgive_dead_player, each gated exactly as vanilla's
getPersistentAngerTarget() gate is:

  • Enderman / ZombifiedPiglin — the held target is their anger: when it is
    the dying player, the target and the last hurt by go (vanilla's
    stopBeingAngry clears setLastHurtByMob too).
  • IronGolem — its timer and target end together, only while the anger
    runs and the target is the player.
  • Anger at another mob is untouched (a golem after a zombie, a piglin's
    reinforcements target), and the tame, bee and polar-bear paths are exactly
    main's.

Testing

  • tools/pr_ready.py --quick green: 481 Python tests, rustfmt, clippy
    -D warnings, 1087 horizon-client tests — including two new ones:
    the enderman and zombified piglin lose a player target and keep a mob
    target; the iron golem's timer and target end together and stay for a mob
    target.
  • The live check (a stared-at enderman still angry after death) is CI's
    harnesses' to pick; the parity jobs decide.

Label: none (a fix).


🔄 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/4636 **Author:** [@JustKarkat](https://github.com/JustKarkat) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/target-anger-death-forgiveness` --- ### 📝 Commits (1) - [`f5c7906`](https://github.com/horizon-rust/horizon/commit/f5c79065e96b83514acb04f289ffaf400d3c7876) A dying player's forgiveness reaches the target-anger mobs ### 📊 Changes **1 file changed** (+75 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/ai.rs` (+75 -0) </details> ### 📄 Description > 🤖 Opened by JustKarkat's AI agent (ZCode) ## The gap #3507 was closed with "main now already contains this behaviour" — the area (`Aabb(blockPosition()).inflate(32, 10, 32)`) and the per-species gates do live on main. But the dispatch's default arm is the tame gate, which needs `extra.angry_at` — a field only the wolf's anger ever writes (`git grep "extra.angry_at ="` on main: `tame.rs` alone). So three of vanilla 26.3's six `NeutralMob` implementers are never forgiven when the player they are angry at dies: | Mob | Its persistent anger on main | Vanilla's `playerDied` | |---|---|---| | Enderman | `ai.target` (the stare goal; nothing writes `angry_at`) | `stopBeingAngry` clears it | | ZombifiedPiglin | `ai.target` (the hurt-by path) | same | | IronGolem | `extra.anger` timer + `ai.target` (after a player's hit, ai.rs's `after_hurt`) | same | Checked with javap on the 26.3 jar: `net.minecraft.world.entity.monster.Enderman` and `...zombie.ZombifiedPiglin` both `implement net.minecraft.world.entity.NeutralMob` (the enderman's `setPersistentAngerTarget` is its `setTarget`), and `NeutralMob.playerDied` is the default method that ends the anger at the dying player. A stared-at enderman and a provoked zombified piglin keep attacking through death and respawn on main today; vanilla drops it. ## The fix Three arms in `forgive_dead_player`, each gated exactly as vanilla's `getPersistentAngerTarget()` gate is: - **Enderman / ZombifiedPiglin** — the held target is their anger: when it is the dying player, the target and the last hurt by go (vanilla's `stopBeingAngry` clears `setLastHurtByMob` too). - **IronGolem** — its timer and target end together, only while the anger runs and the target is the player. - Anger at another mob is untouched (a golem after a zombie, a piglin's reinforcements target), and the tame, bee and polar-bear paths are exactly main's. ## Testing - `tools/pr_ready.py --quick` green: 481 Python tests, rustfmt, clippy `-D warnings`, 1087 horizon-client tests — including two new ones: the enderman and zombified piglin lose a player target and keep a mob target; the iron golem's timer and target end together and stay for a mob target. - The live check (a stared-at enderman still angry after death) is CI's harnesses' to pick; the parity jobs decide. Label: none (a fix). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:41 +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#5744
No description provided.