[PR #2403] [MERGED] Cats lie beside a sleeping owner and leave a morning gift #4282

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

📋 Pull Request Information

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

Base: main ← Head: fix/cat-morning-gift


📝 Commits (6)

  • 23019a7 Cats lie beside a sleeping owner and may leave a morning gift
  • b0ce58a Check the cat's owner and sync lying and relaxing to clients
  • af548f5 Merge main into fix/cat-morning-gift
  • d5aa3f6 Name the cat relax goal's owner check is_owner_of
  • 0762f49 Merge main into fix/cat-morning-gift
  • ed652da Merge main into fix/cat-morning-gift

📊 Changes

8 files changed (+280 additions, -6 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+2 -0)
📝 crates/horizon-client/src/game/creatures.rs (+18 -0)
📝 crates/horizon-client/src/game/lan.rs (+9 -0)
📝 crates/horizon-client/src/game/lan_mobs.rs (+16 -0)
📝 crates/horizon-client/src/game/remote.rs (+5 -0)
📝 crates/horizon-client/src/game/remote_mob_data.rs (+3 -0)
📝 crates/horizon-client/src/mobs.rs (+14 -0)
📝 crates/horizon-client/src/mobs/tame.rs (+213 -6)

📄 Description

What and why

A tamed cat never came to a sleeping owner and never left a morning gift. Horizon had no CatRelaxOnOwnerGoal.

Now, like vanilla, a tame cat that is not told to sit walks to the foot of its owner's bed while the owner sleeps (owner within 10 blocks, no other cat lying or relaxing nearby), watches them for a moment, then lies down and purrs. When the owner wakes up having slept the full 100 ticks, the cat gives a gift with the day timeline's chance (0.7 in the morning, 0 otherwise): it hops to a spot within five blocks (avoiding #dangerous_for_teleportation) and drops one item from gameplay/cat_morning_gift.

Along the way the cat's purr and its relaxed-pose blend now follow the relaxing state, as in Cat.handleLieDown.

Not done: a leashed cat hops around its leash holder instead of itself, and the gift's random sequence is not vanilla's per-table sequence.

Vanilla reference

  • Cat.CatRelaxOnOwnerGoal (canUse, canContinueToUse, start, tick, stop, giveMorningGift, spaceIsOccupied), registered at priority 3 in Cat.registerGoals.
  • Cat.handleLieDown / updateRelaxStateOneAmount.
  • LivingEntity.randomTeleport for the hop, Player.stopSleepInBed for the sleep timer of 100.
  • data/minecraft/timeline/day.json (gameplay/cat_waking_up_gift_chance) and loot_table/gameplay/cat_morning_gift.json.

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/2403 **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-morning-gift` --- ### 📝 Commits (6) - [`23019a7`](https://github.com/horizon-rust/horizon/commit/23019a7bf999938e19c0d7c0de33f7a43f049485) Cats lie beside a sleeping owner and may leave a morning gift - [`b0ce58a`](https://github.com/horizon-rust/horizon/commit/b0ce58adeab076fe9bd0eb93ff3c985032be6267) Check the cat's owner and sync lying and relaxing to clients - [`af548f5`](https://github.com/horizon-rust/horizon/commit/af548f5ae897f965dbfb2b0a25e7af37f734c682) Merge main into fix/cat-morning-gift - [`d5aa3f6`](https://github.com/horizon-rust/horizon/commit/d5aa3f6e4256e8631cd14a1ad651fab5074f9efe) Name the cat relax goal's owner check is_owner_of - [`0762f49`](https://github.com/horizon-rust/horizon/commit/0762f49f20fb6c2788a3203a1a47345051c589da) Merge main into fix/cat-morning-gift - [`ed652da`](https://github.com/horizon-rust/horizon/commit/ed652da57257acfcb46680bb21aaf7de9cd303cd) Merge main into fix/cat-morning-gift ### 📊 Changes **8 files changed** (+280 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+2 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+18 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+9 -0) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+16 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+5 -0) 📝 `crates/horizon-client/src/game/remote_mob_data.rs` (+3 -0) 📝 `crates/horizon-client/src/mobs.rs` (+14 -0) 📝 `crates/horizon-client/src/mobs/tame.rs` (+213 -6) </details> ### 📄 Description ## What and why A tamed cat never came to a sleeping owner and never left a morning gift. Horizon had no `CatRelaxOnOwnerGoal`. Now, like vanilla, a tame cat that is not told to sit walks to the foot of its owner's bed while the owner sleeps (owner within 10 blocks, no other cat lying or relaxing nearby), watches them for a moment, then lies down and purrs. When the owner wakes up having slept the full 100 ticks, the cat gives a gift with the day timeline's chance (0.7 in the morning, 0 otherwise): it hops to a spot within five blocks (avoiding `#dangerous_for_teleportation`) and drops one item from `gameplay/cat_morning_gift`. Along the way the cat's purr and its relaxed-pose blend now follow the relaxing state, as in `Cat.handleLieDown`. Not done: a leashed cat hops around its leash holder instead of itself, and the gift's random sequence is not vanilla's per-table sequence. ## Vanilla reference - `Cat.CatRelaxOnOwnerGoal` (`canUse`, `canContinueToUse`, `start`, `tick`, `stop`, `giveMorningGift`, `spaceIsOccupied`), registered at priority 3 in `Cat.registerGoals`. - `Cat.handleLieDown` / `updateRelaxStateOneAmount`. - `LivingEntity.randomTeleport` for the hop, `Player.stopSleepInBed` for the sleep timer of 100. - `data/minecraft/timeline/day.json` (`gameplay/cat_waking_up_gift_chance`) and `loot_table/gameplay/cat_morning_gift.json`. ## 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:16:02 +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#4282
No description provided.