[PR #1811] [MERGED] Peaceful zombie horses spawn without their zombie rider #3781

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

📋 Pull Request Information

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

Base: main ← Head: fix/zombie-horseman-peaceful


📝 Commits (1)

  • e9d2c10 Peaceful zombie horses spawn without their zombie rider

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game/passengers.rs (+10 -2)

📄 Description

🤖 Opened by vlesmentie's AI agent (Claude Code, Claude Opus 5.5), not by vlesmentie themselves.

What and why

Fixes #1761.

In peaceful, natural zombie horses spawned with a zombie rider holding an iron spear. Vanilla spawns the zombie
horse alone there: ZombieHorse.finalizeSpawn gets its rider from EntityTypes.ZOMBIE.create(level, JOCKEY), and
EntityType.create returns null when canSpawn fails, which it does for a notInPeaceful type (the zombie) in
peaceful. The zombie horse itself is not notInPeaceful and its placement rule is
Monster.checkMonsterSpawnRules (light only), so in 26.3 it still spawns naturally in peaceful, riderless.

mobs/finalize.rs (the code test_finalize_spawn_parity.py checks) already gets this right through
level.create. The game's own copy in game/passengers.rs (spawn_jockeys) called spawn_mob("minecraft:zombie")
with no such check. It now skips the rider when the world is peaceful and the zombie is not allowed in peaceful,
as EntityType.canSpawn does. Skipping it also skips the rider's spawn_mob random draws (yaw, finalizeSpawn),
which vanilla never makes when create returns null.

Vanilla reference

  • ZombieHorse.finalizeSpawn (rider from EntityType.create(Level, EntitySpawnReason.JOCKEY), skipped when null)
  • EntityType.create(Level, EntitySpawnRequest) → EntityType.canSpawn(Level): isAllowedInPeaceful() or
    difficulty is not PEACEFUL
  • EntityTypes: ZOMBIE is built with notInPeaceful(), ZOMBIE_HORSE is not (MobCategory.MONSTER)
  • SpawnPlacements: ZOMBIE_HORSE uses Monster.checkMonsterSpawnRules
  • ServerLevel.isSpawningMonsters (only spawn_mobs and spawn_monsters, no difficulty), so zombie horses do
    spawn naturally in peaceful

Checked against the 26.3 client jar's bytecode (javap). Harness: test_finalize_spawn_parity.py already covers
zombie horse jockeys in peaceful for mobs/finalize.rs; this brings game/passengers.rs in line with it.

Self-check

pr_ready (tools/pr_ready.py on debian, against origin/main at c143be7fd, 7 min 18 s)

Check Result
Scope ✅ 1 files, +10 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (16 s)
clippy ✅ (1 min 43 s)
tests: horizon-client ✅ 1225 passed (5 min 13 s)
doc tests ✅ 0 passed (5 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

(Run before rebasing onto the current main; the 24 commits since then don't touch game/passengers.rs.)

Not checked in game: this machine has no prepared vanilla data, so the change rests on the bytecode reading
above and on matching mobs/finalize.rs.

🤖 Generated with Claude Code


🔄 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/1811 **Author:** [@vlesmentie](https://github.com/vlesmentie) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/zombie-horseman-peaceful` --- ### 📝 Commits (1) - [`e9d2c10`](https://github.com/horizon-rust/horizon/commit/e9d2c1041774e9e291c2b8e360bf5c7e2485ffb7) Peaceful zombie horses spawn without their zombie rider ### 📊 Changes **1 file changed** (+10 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/passengers.rs` (+10 -2) </details> ### 📄 Description > 🤖 Opened by vlesmentie's AI agent (Claude Code, Claude Opus 5.5), not by vlesmentie themselves. ## What and why Fixes #1761. In peaceful, natural zombie horses spawned with a zombie rider holding an iron spear. Vanilla spawns the zombie horse alone there: `ZombieHorse.finalizeSpawn` gets its rider from `EntityTypes.ZOMBIE.create(level, JOCKEY)`, and `EntityType.create` returns null when `canSpawn` fails, which it does for a `notInPeaceful` type (the zombie) in peaceful. The zombie horse itself is not `notInPeaceful` and its placement rule is `Monster.checkMonsterSpawnRules` (light only), so in 26.3 it still spawns naturally in peaceful, riderless. `mobs/finalize.rs` (the code `test_finalize_spawn_parity.py` checks) already gets this right through `level.create`. The game's own copy in `game/passengers.rs` (`spawn_jockeys`) called `spawn_mob("minecraft:zombie")` with no such check. It now skips the rider when the world is peaceful and the zombie is not allowed in peaceful, as `EntityType.canSpawn` does. Skipping it also skips the rider's `spawn_mob` random draws (yaw, finalizeSpawn), which vanilla never makes when `create` returns null. ## Vanilla reference - `ZombieHorse.finalizeSpawn` (rider from `EntityType.create(Level, EntitySpawnReason.JOCKEY)`, skipped when null) - `EntityType.create(Level, EntitySpawnRequest)` → `EntityType.canSpawn(Level)`: `isAllowedInPeaceful()` or difficulty is not `PEACEFUL` - `EntityTypes`: `ZOMBIE` is built with `notInPeaceful()`, `ZOMBIE_HORSE` is not (`MobCategory.MONSTER`) - `SpawnPlacements`: `ZOMBIE_HORSE` uses `Monster.checkMonsterSpawnRules` - `ServerLevel.isSpawningMonsters` (only `spawn_mobs` and `spawn_monsters`, no difficulty), so zombie horses do spawn naturally in peaceful Checked against the 26.3 client jar's bytecode (`javap`). Harness: `test_finalize_spawn_parity.py` already covers zombie horse jockeys in peaceful for `mobs/finalize.rs`; this brings `game/passengers.rs` in line with it. ## Self-check **pr_ready** (`tools/pr_ready.py` on debian, against origin/main at c143be7fd, 7 min 18 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +10 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (16 s) | | clippy | ✅ (1 min 43 s) | | tests: horizon-client | ✅ 1225 passed (5 min 13 s) | | doc tests | ✅ 0 passed (5 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | (Run before rebasing onto the current main; the 24 commits since then don't touch `game/passengers.rs`.) Not checked in game: this machine has no prepared vanilla data, so the change rests on the bytecode reading above and on matching `mobs/finalize.rs`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:16 +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#3781
No description provided.