[PR #2205] [MERGED] Let turtles lay eggs that hatch into baby turtles #4103

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

📋 Pull Request Information

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

Base: main ← Head: fix/turtle-eggs


📝 Commits (3)

  • bd59cdc Let turtles lay eggs that hatch into baby turtles
  • 608a6d9 Turtles: a fixed home from spawn or load, one breeding orb
  • 6ef61ac Merge origin/main into the turtle branch

📊 Changes

9 files changed (+339 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+18 -0)
📝 crates/horizon-client/src/game.rs (+5 -0)
📝 crates/horizon-client/src/game/creatures.rs (+70 -2)
📝 crates/horizon-client/src/mobs.rs (+7 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+12 -0)
📝 crates/horizon-client/src/mobs/body_anim.rs (+2 -2)
📝 crates/horizon-client/src/mobs/goals.rs (+8 -0)
📝 crates/horizon-client/src/mobs/spawning.rs (+8 -0)
➕ crates/horizon-client/src/mobs/turtle.rs (+209 -0)

📄 Description

What and why

Turtles never laid eggs, and an egg that reached its last hatch stage was removed without any baby appearing (the level emits hatch_turtles and nothing handled it). Turtles also had no breeding goal at all, only the generic stroll and panic goals.

  • Hatching: hatch_turtles spawns one baby turtle per egg (age -24000) at the egg, with the egg as its home position. The sound, crumbs and block removal already come from the level.
  • Growing up: a baby turtle that reaches age 0, by time or by food, drops a scute from the gameplay/turtle_grow loot table, only while mob loot is on.
  • Breeding: turtles now have the breed goal. As in TurtleBreedGoal.breed, the mother gets an egg instead of a baby, both parents get the 6000 tick cooldown, and the experience orb and the "animals bred" stat and trigger still happen (the trigger gets no child, as in vanilla). A turtle carrying an egg does not breed again.
  • Laying: a mother with an egg within 9 blocks of home looks for sand with air above within 16 blocks, walks there, digs for 200 ticks with sand crumbs every fifth tick, then places a turtle_egg with 1 to 4 eggs, plays the sound, loses the egg and is in love again. A mother with an egg walks home (TurtleGoHomeGoal); an adult 64 blocks from home also heads back now and then.
  • The turtle model now shows the egg belly and the digging legs, and has_egg and home_pos are saved and loaded.

Left out: the turtle's tempt, go-to-water and travel goals and its own panic goal, which have nothing to do with eggs, and the egg flag for LAN guests' models.

Vanilla reference

  • Turtle.TurtleBreedGoal.breed, TurtleLayEggGoal, TurtleGoHomeGoal, Turtle.aiStep, Turtle.ageBoundaryReached
  • TurtleEggBlock.randomTick
  • MoveToBlockGoal

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/2205 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/turtle-eggs` --- ### 📝 Commits (3) - [`bd59cdc`](https://github.com/horizon-rust/horizon/commit/bd59cdc25cc3da28287933f55aa0aaf0a5608cd0) Let turtles lay eggs that hatch into baby turtles - [`608a6d9`](https://github.com/horizon-rust/horizon/commit/608a6d9bee44680bb640777663d2c3258e5590b4) Turtles: a fixed home from spawn or load, one breeding orb - [`6ef61ac`](https://github.com/horizon-rust/horizon/commit/6ef61ac13b67a3cbe7e538e4fa1d005cf1047490) Merge origin/main into the turtle branch ### 📊 Changes **9 files changed** (+339 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+18 -0) 📝 `crates/horizon-client/src/game.rs` (+5 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+70 -2) 📝 `crates/horizon-client/src/mobs.rs` (+7 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+12 -0) 📝 `crates/horizon-client/src/mobs/body_anim.rs` (+2 -2) 📝 `crates/horizon-client/src/mobs/goals.rs` (+8 -0) 📝 `crates/horizon-client/src/mobs/spawning.rs` (+8 -0) ➕ `crates/horizon-client/src/mobs/turtle.rs` (+209 -0) </details> ### 📄 Description ## What and why Turtles never laid eggs, and an egg that reached its last hatch stage was removed without any baby appearing (the level emits `hatch_turtles` and nothing handled it). Turtles also had no breeding goal at all, only the generic stroll and panic goals. - Hatching: `hatch_turtles` spawns one baby turtle per egg (age -24000) at the egg, with the egg as its home position. The sound, crumbs and block removal already come from the level. - Growing up: a baby turtle that reaches age 0, by time or by food, drops a scute from the `gameplay/turtle_grow` loot table, only while mob loot is on. - Breeding: turtles now have the breed goal. As in `TurtleBreedGoal.breed`, the mother gets an egg instead of a baby, both parents get the 6000 tick cooldown, and the experience orb and the "animals bred" stat and trigger still happen (the trigger gets no child, as in vanilla). A turtle carrying an egg does not breed again. - Laying: a mother with an egg within 9 blocks of home looks for sand with air above within 16 blocks, walks there, digs for 200 ticks with sand crumbs every fifth tick, then places a `turtle_egg` with 1 to 4 eggs, plays the sound, loses the egg and is in love again. A mother with an egg walks home (`TurtleGoHomeGoal`); an adult 64 blocks from home also heads back now and then. - The turtle model now shows the egg belly and the digging legs, and `has_egg` and `home_pos` are saved and loaded. Left out: the turtle's tempt, go-to-water and travel goals and its own panic goal, which have nothing to do with eggs, and the egg flag for LAN guests' models. ## Vanilla reference - `Turtle.TurtleBreedGoal.breed`, `TurtleLayEggGoal`, `TurtleGoHomeGoal`, `Turtle.aiStep`, `Turtle.ageBoundaryReached` - `TurtleEggBlock.randomTick` - `MoveToBlockGoal` ## 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: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#4103
No description provided.