[PR #3507] [CLOSED] A dying player's forgiveness reaches the neutral mobs #5032

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3507
Author: @JustKarkat
Created: 10/29/2026
Status: ❌ Closed

Base: main ← Head: fix/forgive-dead-players


📝 Commits (10+)

  • 7f870d7 Merge pull request #3563 from d3grando/fix-3322
  • 3c63c59 run-parity: a push cancels the old head's run, other labels cancel nothing; cancel-on-close takes every head (#3651)
  • 58a4fd8 Merge pull request #3571 from d3grando/fix-3501
  • 215d8e7 Merge pull request #3411 from spidercraft/cape-rendering
  • c10553e Merge pull request #3439 from spidercraft/taa
  • 5e391eb Merge pull request #3500 from spidercraft/fix/firework-gaps
  • 9c5377a Mods: structures, sets, pools and templates from content mods reach command suggestions
  • 7443236 Merge pull request #3445 from d3grando/fix-3414
  • cf586e4 Merge pull request #3442 from d3grando/fix-copper-chest-double
  • 248aa8b Merge pull request #3415 from d3grando/fix-3245

📊 Changes

509 files changed (+45479 additions, -3666 deletions)

View changed files

➕ .claude/skills/vanilla-parity/SKILL.md (+76 -0)
📝 .github/pull_request_template.md (+2 -0)
📝 .github/workflows/cancel-on-close.yml (+6 -4)
📝 .github/workflows/game-build.yml (+5 -4)
📝 .github/workflows/run-parity.yml (+6 -2)
📝 AGENTS.md (+11 -6)
📝 README.md (+11 -6)
📝 ROADMAP.md (+111 -30)
📝 crates/horizon-client-core/src/component.rs (+102 -51)
📝 crates/horizon-client-core/src/lang.rs (+38 -1)
📝 crates/horizon-client-core/src/potions.rs (+2 -1)
📝 crates/horizon-client-core/src/registries.rs (+6 -0)
📝 crates/horizon-client-core/src/scoreboard.rs (+16 -4)
📝 crates/horizon-client-core/src/text.rs (+30 -25)
📝 crates/horizon-client-input/src/clipboard.rs (+29 -0)
📝 crates/horizon-client-input/src/keybinds.rs (+48 -13)
➕ crates/horizon-client-render/examples/compositor.rs (+151 -0)
📝 crates/horizon-client-render/src/assets.rs (+2 -1)
📝 crates/horizon-client-render/src/atlas_sources.rs (+8 -1)
📝 crates/horizon-client-render/src/biome.rs (+4 -0)

...and 80 more files

📄 Description

🤖 Opened by JustKarkat's AI agent (ZCode)

The bug

#3155: with forgive_dead_players at its default true, the four mobs
the report names (iron golem, wolf, zombified piglin, enderman) stayed
angry through the player's death and attacked again at once on respawn.

ServerPlayer.die → tellNeutralMobsThatIDied asks the level for every
NeutralMob in the dying player's block cell grown 32 blocks sideways
and 10 up and down and stops the anger of the ones whose persistent
anger is at that player, when the gamerule allows. Nothing here ran
that step.

The fix

  • Game's death block, behind the gamerule, walks the mobs in
    mobs::ai::forgiveness_area(feet) — the block cell
    [floor(feet), +1) inflated by Vec3::new(32.0, 10.0, 32.0), as
    new AABB(blockPosition()).inflate(32.0, 10.0, 32.0) — and ends the
    anger of every mob that passes two gates (mobs::ai):
    • is_neutral is 26.3's NeutralMob implementer set: bee, enderman,
      iron golem, polar bear, wolf, zombified piglin.
    • angry_at_player is NeutralMob.playerDied's
      getPersistentAngerTarget gate: the bee's own state's angry_at,
      the polar bear's flag2 behind its player target, the enderman its
      player target (its stare aggro), the rest anger > 0 and a player
      target. A wolf angry at a skeleton keeps its anger.
  • stop_being_angry then clears fully, as NeutralMob.stopBeingAngry:
    the last hurt by, the persistent target and the target all go and the
    end time is -1. Bees end their own state (bee::stop_being_angry),
    the polar bear its flag2 (polar_bear::stop_being_angry).

Five unit tests cover the class set, the gate (a wolf at a skeleton
keeps its anger), the polar bear's flag, the bee's own state and the
area (20 blocks out is in, 34 out and 12 up are not).

Review

The first push was corrected after review by @d3grando's and
@ludovic111's agents: the area had been the player's box grown 10 on
every axis (never reaching 11–32 blocks out), the anger of every
neutral mob in range was cleared regardless of its target, and three
non-implementers (panda, spider, trader llama) were in the class set.

Self-check

pr_ready (tools/pr_ready.py --quick on cachy-josh-pc, against origin/main at 299c0b495)

Check Result
Scope ✅ 3 files, +179 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed (23 s)
rustfmt ✅ (4 s)
clippy ✅ (14 s)
tests: horizon-client ✅ 1297 passed (1 min 6 s)
doc tests ✅ 0 passed (5 s)
Parity ➖ to run in CI

The first push's full pr_ready run is on the initial commit's
description: everything green but the parity harnesses, which fail on
this machine for an environment reason this branch does not touch —
UnsupportedClassVersionError ... class file version 69.0, this version of the Java Runtime only recognizes class file versions up to 61.0
(local Java 17 cannot run the vanilla server). CI's run-parity decides.

Fixes #3155.


🔄 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/3507 **Author:** [@JustKarkat](https://github.com/JustKarkat) **Created:** 10/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/forgive-dead-players` --- ### 📝 Commits (10+) - [`7f870d7`](https://github.com/horizon-rust/horizon/commit/7f870d7447c252f1da567eea0beda614bc0f2c3a) Merge pull request #3563 from d3grando/fix-3322 - [`3c63c59`](https://github.com/horizon-rust/horizon/commit/3c63c5913e398722019c8db8c99976f932eaa688) run-parity: a push cancels the old head's run, other labels cancel nothing; cancel-on-close takes every head (#3651) - [`58a4fd8`](https://github.com/horizon-rust/horizon/commit/58a4fd8263a521dffe1076e9b85123fb246ec2fb) Merge pull request #3571 from d3grando/fix-3501 - [`215d8e7`](https://github.com/horizon-rust/horizon/commit/215d8e779a774670ddb001c66c567828febfff4d) Merge pull request #3411 from spidercraft/cape-rendering - [`c10553e`](https://github.com/horizon-rust/horizon/commit/c10553eebf4c6527ebe5448daf1b915b9e83d25a) Merge pull request #3439 from spidercraft/taa - [`5e391eb`](https://github.com/horizon-rust/horizon/commit/5e391eb67392941734df7ddd648728c4ed5302f6) Merge pull request #3500 from spidercraft/fix/firework-gaps - [`9c5377a`](https://github.com/horizon-rust/horizon/commit/9c5377a57159a5e92a4a30f3d6b10a7ebcb5e660) Mods: structures, sets, pools and templates from content mods reach command suggestions - [`7443236`](https://github.com/horizon-rust/horizon/commit/74432368506bd4cde3edfb20eb7cc6afc1ea2bdf) Merge pull request #3445 from d3grando/fix-3414 - [`cf586e4`](https://github.com/horizon-rust/horizon/commit/cf586e4159583e7f4cf70a3c108846f158f36b4f) Merge pull request #3442 from d3grando/fix-copper-chest-double - [`248aa8b`](https://github.com/horizon-rust/horizon/commit/248aa8b302488523fd1ea5baf56fbd13b9284742) Merge pull request #3415 from d3grando/fix-3245 ### 📊 Changes **509 files changed** (+45479 additions, -3666 deletions) <details> <summary>View changed files</summary> ➕ `.claude/skills/vanilla-parity/SKILL.md` (+76 -0) 📝 `.github/pull_request_template.md` (+2 -0) 📝 `.github/workflows/cancel-on-close.yml` (+6 -4) 📝 `.github/workflows/game-build.yml` (+5 -4) 📝 `.github/workflows/run-parity.yml` (+6 -2) 📝 `AGENTS.md` (+11 -6) 📝 `README.md` (+11 -6) 📝 `ROADMAP.md` (+111 -30) 📝 `crates/horizon-client-core/src/component.rs` (+102 -51) 📝 `crates/horizon-client-core/src/lang.rs` (+38 -1) 📝 `crates/horizon-client-core/src/potions.rs` (+2 -1) 📝 `crates/horizon-client-core/src/registries.rs` (+6 -0) 📝 `crates/horizon-client-core/src/scoreboard.rs` (+16 -4) 📝 `crates/horizon-client-core/src/text.rs` (+30 -25) 📝 `crates/horizon-client-input/src/clipboard.rs` (+29 -0) 📝 `crates/horizon-client-input/src/keybinds.rs` (+48 -13) ➕ `crates/horizon-client-render/examples/compositor.rs` (+151 -0) 📝 `crates/horizon-client-render/src/assets.rs` (+2 -1) 📝 `crates/horizon-client-render/src/atlas_sources.rs` (+8 -1) 📝 `crates/horizon-client-render/src/biome.rs` (+4 -0) _...and 80 more files_ </details> ### 📄 Description > 🤖 Opened by JustKarkat's AI agent (ZCode) ## The bug #3155: with `forgive_dead_players` at its default `true`, the four mobs the report names (iron golem, wolf, zombified piglin, enderman) stayed angry through the player's death and attacked again at once on respawn. `ServerPlayer.die` → `tellNeutralMobsThatIDied` asks the level for every `NeutralMob` in the dying player's block cell grown 32 blocks sideways and 10 up and down and stops the anger of the ones whose persistent anger is at that player, when the gamerule allows. Nothing here ran that step. ## The fix - `Game`'s death block, behind the gamerule, walks the mobs in `mobs::ai::forgiveness_area(feet)` — the block cell `[floor(feet), +1)` inflated by `Vec3::new(32.0, 10.0, 32.0)`, as `new AABB(blockPosition()).inflate(32.0, 10.0, 32.0)` — and ends the anger of every mob that passes two gates (`mobs::ai`): - `is_neutral` is 26.3's `NeutralMob` implementer set: bee, enderman, iron golem, polar bear, wolf, zombified piglin. - `angry_at_player` is `NeutralMob.playerDied`'s `getPersistentAngerTarget` gate: the bee's own state's `angry_at`, the polar bear's `flag2` behind its player target, the enderman its player target (its stare aggro), the rest `anger > 0` and a player target. A wolf angry at a skeleton keeps its anger. - `stop_being_angry` then clears fully, as `NeutralMob.stopBeingAngry`: the last hurt by, the persistent target and the target all go and the end time is -1. Bees end their own state (`bee::stop_being_angry`), the polar bear its `flag2` (`polar_bear::stop_being_angry`). Five unit tests cover the class set, the gate (a wolf at a skeleton keeps its anger), the polar bear's flag, the bee's own state and the area (20 blocks out is in, 34 out and 12 up are not). ## Review The first push was corrected after review by @d3grando's and @ludovic111's agents: the area had been the player's box grown 10 on every axis (never reaching 11–32 blocks out), the anger of every neutral mob in range was cleared regardless of its target, and three non-implementers (panda, spider, trader llama) were in the class set. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on cachy-josh-pc, against origin/main at 299c0b495) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +179 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (23 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (14 s) | | tests: horizon-client | ✅ 1297 passed (1 min 6 s) | | doc tests | ✅ 0 passed (5 s) | | Parity | ➖ to run in CI | The first push's full `pr_ready` run is on the initial commit's description: everything green but the parity harnesses, which fail on this machine for an environment reason this branch does not touch — `UnsupportedClassVersionError ... class file version 69.0, this version of the Java Runtime only recognizes class file versions up to 61.0` (local Java 17 cannot run the vanilla server). CI's run-parity decides. Fixes #3155. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:09:44 +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#5032
No description provided.