[PR #4559] [MERGED] Frogs breed: slimeball feeding, pregnancy, and frogspawn laid on water #5694

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

📋 Pull Request Information

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

Base: main ← Head: fix/frog-breeding


📝 Commits (1)

  • a9b932e Frogs breed: slimeball feeding, pregnancy, and frogspawn laid on water

📊 Changes

5 files changed (+289 additions, -9 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+11 -0)
📝 crates/horizon-client/src/game/creatures.rs (+2 -2)
📝 crates/horizon-client/src/mobs/frog.rs (+271 -6)
📝 crates/horizon-client/src/mobs/goals.rs (+4 -0)
📝 tools/port_map/game-008.tsv (+1 -1)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally.

Refs #3521 (row TryLaySpawnOnFluidNearLand.create)

What

Frogs could not be bred: they ignored slimeballs, never got pregnant and never laid frogspawn (the block, its hatching and the tadpoles were already there). Now, as in vanilla FrogAi:

  • Feeding and love: a frog follows a player holding a slimeball (FollowTemptation(1.25)) and AnimalMakeLove pairs two fed frogs (Breed, priority above the tempt).
  • Pregnancy: Frog.spawnChildFromBreeding makes no baby; the frog gets IS_PREGNANT (a brain memory, saved as an empty compound under Brain.memories, read back on load). The parents get the usual 6000 tick age, the experience orb and the "bred animals" trigger without a child, as for turtles.
  • Laying (LAY_SPAWN activity): TryFindLandNearLiquid(8, 1.0) finds land (empty block over a solid one) beside water and walks there; TryLaySpawnOnFluidNearLand puts frogspawn on the water next to it, plays entity.frog.lay_spawn and erases the pregnancy. A pregnant frog has no FollowTemptation and does not long jump (activity order), and does not stroll while it walks to the pond.

I read FrogAi, TryFindLandNearLiquid, TryLaySpawnOnFluidNearLand and Frog.spawnChildFromBreeding first and ported them in order, including the search timer quirk (nextOkStartTime is pushed 40 ticks on every call, so the search repeats only after a gap of 40 ticks without the behaviour being tried) and the withinManhattan visiting order (same as bee.rs).

Proof

Real game (horizon-ctl, scratch dirs, a survival player): two frogs on a stone platform with a pond. I feed both a slimeball each (hearts), one goes pregnant (goals shows LaySpawn), walks to the pond's edge and lays frogspawn at the edge of the water (blocks shows minecraft:frogspawn on the water beside where it stood).

Fed (love hearts) Frogspawn on the water

Unit tests: pregnancy memory set/erase, and the land search visiting order. pr_ready --quick: fmt, clippy, 1077 horizon-client tests and 481 Python tests pass.

Notes

  • No tick-for-tick parity check: frogs run on goals standing in for FrogAi's brain, and the mob_ai probe has no frog brain (a frog scenario diverges at tick 0, see the table in #3521). The behaviours were compared with the vanilla classes by reading them.
  • Conditions the goals approximate: "walk target absent/present" is "navigation done/running"; the face-shape test (getFaceShape(UP).isEmpty()) is "the collision box does not reach the top of the block"; the long jump does not check TEMPTING_PLAYER and BREED_TARGET (Breed and Tempt hold the movement at a better priority).
  • Hatching of the frogspawn into tadpoles was already ported (game.rs), not touched.
  • Touches frog.rs like #4539 (other author); the hunks are separate.

🤖 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/4559 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/frog-breeding` --- ### 📝 Commits (1) - [`a9b932e`](https://github.com/horizon-rust/horizon/commit/a9b932e4c2b9d2280b6ae6b4229615d33262520f) Frogs breed: slimeball feeding, pregnancy, and frogspawn laid on water ### 📊 Changes **5 files changed** (+289 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+11 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+2 -2) 📝 `crates/horizon-client/src/mobs/frog.rs` (+271 -6) 📝 `crates/horizon-client/src/mobs/goals.rs` (+4 -0) 📝 `tools/port_map/game-008.tsv` (+1 -1) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally. Refs #3521 (row `TryLaySpawnOnFluidNearLand.create`) ## What Frogs could not be bred: they ignored slimeballs, never got pregnant and never laid frogspawn (the block, its hatching and the tadpoles were already there). Now, as in vanilla `FrogAi`: - **Feeding and love:** a frog follows a player holding a slimeball (`FollowTemptation(1.25)`) and `AnimalMakeLove` pairs two fed frogs (`Breed`, priority above the tempt). - **Pregnancy:** `Frog.spawnChildFromBreeding` makes no baby; the frog gets `IS_PREGNANT` (a brain memory, saved as an empty compound under `Brain.memories`, read back on load). The parents get the usual 6000 tick age, the experience orb and the "bred animals" trigger without a child, as for turtles. - **Laying (`LAY_SPAWN` activity):** `TryFindLandNearLiquid(8, 1.0)` finds land (empty block over a solid one) beside water and walks there; `TryLaySpawnOnFluidNearLand` puts `frogspawn` on the water next to it, plays `entity.frog.lay_spawn` and erases the pregnancy. A pregnant frog has no `FollowTemptation` and does not long jump (activity order), and does not stroll while it walks to the pond. I read `FrogAi`, `TryFindLandNearLiquid`, `TryLaySpawnOnFluidNearLand` and `Frog.spawnChildFromBreeding` first and ported them in order, including the search timer quirk (`nextOkStartTime` is pushed 40 ticks on every call, so the search repeats only after a gap of 40 ticks without the behaviour being tried) and the `withinManhattan` visiting order (same as `bee.rs`). ## Proof Real game (`horizon-ctl`, scratch dirs, a survival player): two frogs on a stone platform with a pond. I feed both a slimeball each (hearts), one goes pregnant (`goals` shows `LaySpawn`), walks to the pond's edge and lays frogspawn at the edge of the water (`blocks` shows `minecraft:frogspawn` on the water beside where it stood). ![](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/frog-breeding/frog-lay.gif) | Fed (love hearts) | Frogspawn on the water | |---|---| | ![](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/frog-breeding/fed.png) | ![](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/frog-breeding/frogspawn.png) | Unit tests: pregnancy memory set/erase, and the land search visiting order. `pr_ready --quick`: fmt, clippy, 1077 `horizon-client` tests and 481 Python tests pass. ## Notes - No tick-for-tick parity check: frogs run on goals standing in for `FrogAi`'s brain, and the `mob_ai` probe has no frog brain (a frog scenario diverges at tick 0, see the table in #3521). The behaviours were compared with the vanilla classes by reading them. - Conditions the goals approximate: "walk target absent/present" is "navigation done/running"; the face-shape test (`getFaceShape(UP).isEmpty()`) is "the collision box does not reach the top of the block"; the long jump does not check `TEMPTING_PLAYER` and `BREED_TARGET` (Breed and Tempt hold the movement at a better priority). - Hatching of the frogspawn into tadpoles was already ported (`game.rs`), not touched. - Touches `frog.rs` like #4539 (other author); the hunks are separate. 🤖 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 05:14:22 +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#5694
No description provided.