[PR #2334] [MERGED] Spawn village and swamp hut cats #4215

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

📋 Pull Request Information

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

Base: main ← Head: fix/cat-spawner


📝 Commits (2)

  • fece9d8 Spawn village and swamp hut cats
  • 033d704 Merge main into fix/cat-spawner

📊 Changes

3 files changed (+143 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+2 -0)
➕ crates/horizon-client/src/game/cat_spawner.rs (+138 -0)
📝 crates/horizon-client/src/game/creatures.rs (+3 -0)

📄 Description

What and why

Village cats and swamp hut cats never appeared in a new world: only structure generation placed them. Vanilla also runs a cat spawner every 1200 ticks, so cats keep arriving near villages and huts.

This adds that spawner next to the wandering trader and patrol spawners. Every 1200 ticks it picks a random living player, offsets 8 to 31 blocks in x and z (random sign), checks the area is loaded and the spot is a valid cat position. Then:

  • Close to a village (2 sections): if more than 4 villager-claimed beds are within 48 blocks and fewer than 5 cats are around, a cat spawns.
  • Inside a cats_spawn_in structure piece (swamp hut): if no cat is within 16 blocks, a persistent cat spawns.

Cats get the normal biome variant, and black inside cats_spawn_as_black structures. It runs in the overworld only and only with spawn_mobs, and it covers LAN guests as players.

Vanilla reference

  • CatSpawner.tick, spawnInVillage, spawnInHut, spawnCat
  • SpawnPlacements.isSpawnPositionOk (cat is on-ground)
  • ServerLevel.getRandomPlayer, PoiManager.getCountInRange (home POIs, occupied)

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/2334 **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/cat-spawner` --- ### 📝 Commits (2) - [`fece9d8`](https://github.com/horizon-rust/horizon/commit/fece9d85e367950f84e96c98cddcc749bbd78504) Spawn village and swamp hut cats - [`033d704`](https://github.com/horizon-rust/horizon/commit/033d704ac5f629008d68ffeb39139ecb3bfff086) Merge main into fix/cat-spawner ### 📊 Changes **3 files changed** (+143 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+2 -0) ➕ `crates/horizon-client/src/game/cat_spawner.rs` (+138 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+3 -0) </details> ### 📄 Description ## What and why Village cats and swamp hut cats never appeared in a new world: only structure generation placed them. Vanilla also runs a cat spawner every 1200 ticks, so cats keep arriving near villages and huts. This adds that spawner next to the wandering trader and patrol spawners. Every 1200 ticks it picks a random living player, offsets 8 to 31 blocks in x and z (random sign), checks the area is loaded and the spot is a valid cat position. Then: - Close to a village (2 sections): if more than 4 villager-claimed beds are within 48 blocks and fewer than 5 cats are around, a cat spawns. - Inside a `cats_spawn_in` structure piece (swamp hut): if no cat is within 16 blocks, a persistent cat spawns. Cats get the normal biome variant, and black inside `cats_spawn_as_black` structures. It runs in the overworld only and only with `spawn_mobs`, and it covers LAN guests as players. ## Vanilla reference - `CatSpawner.tick`, `spawnInVillage`, `spawnInHut`, `spawnCat` - `SpawnPlacements.isSpawnPositionOk` (cat is on-ground) - `ServerLevel.getRandomPlayer`, `PoiManager.getCountInRange` (home POIs, occupied) ## 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:33 +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#4215
No description provided.