[PR #2402] [MERGED] Let parrots imitate nearby mobs and dance to a jukebox #4281

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/2402
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/parrot-imitate-dance


📝 Commits (4)

  • 78a5ee0 Let parrots imitate nearby mobs and dance to a jukebox
  • 7eaa5f5 Send jukebox play and stop events to guests so their parrots dance
  • 1e741d1 Merge main into fix/parrot-imitate-dance
  • 639ac0e Merge main into fix/parrot-imitate-dance

📊 Changes

7 files changed (+206 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+10 -0)
📝 crates/horizon-client/src/game/jukebox.rs (+34 -3)
📝 crates/horizon-client/src/game/lan.rs (+11 -0)
📝 crates/horizon-client/src/mobs.rs (+6 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+4 -0)
📝 crates/horizon-client/src/mobs/body_anim.rs (+3 -1)
➕ crates/horizon-client/src/mobs/parrot.rs (+138 -0)

📄 Description

What and why

Parrots only made their own sound and never danced. Now:

  • One tick in 400 a parrot imitates a mob: half the time it picks a random imitable mob (the Parrot.MOB_SOUND_MAP types) within 20 blocks and plays that mob's entity.parrot.imitate.* sound at 0.7 volume. Silent parrots and silent mobs stay quiet.
  • The parrot's ambient sound is now Parrot.getAmbient: outside peaceful, one time in a thousand it is the voice of a random imitable mob.
  • A parrot near a playing jukebox uses the party pose (legs spread, head swaying). The jukebox is remembered when level event 1010 reaches the parrot's box inflated by 3, forgotten on 1011, and dropped when it is more than 3.46 blocks from the parrot or is no longer a jukebox. The game's own jukebox start and stop notify nearby parrots the same way.

Not covered: the in-process server does not send level event 1010 to its window, so a parrot on the window side of the default server-thread mode only dances once such an event arrives (a vanilla server sends it). The imitation and ambient sounds work there, because they come from the server. Parrots on a shoulder (ServerPlayer.playShoulderEntityAmbientSound) are not touched here.

Vanilla reference

  • Parrot.aiStep (jukebox.closerToCenterThan(position, 3.46), nextInt(400)), imitateNearbyMobs, getAmbient, getPitch, MOB_SOUND_MAP, setRecordPlayingNearby.
  • LevelEventHandler.notifyNearbyEntities (events 1010 and 1011), ParrotModel.getPose (party first).

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/2402 **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/parrot-imitate-dance` --- ### 📝 Commits (4) - [`78a5ee0`](https://github.com/horizon-rust/horizon/commit/78a5ee0e55c8944114a77f465c1ddbfbb5d5d3f0) Let parrots imitate nearby mobs and dance to a jukebox - [`7eaa5f5`](https://github.com/horizon-rust/horizon/commit/7eaa5f592bf777340b949253732253bbb70df1ea) Send jukebox play and stop events to guests so their parrots dance - [`1e741d1`](https://github.com/horizon-rust/horizon/commit/1e741d15286ccdeb2899773d5aa1b5ccef69fe0f) Merge main into fix/parrot-imitate-dance - [`639ac0e`](https://github.com/horizon-rust/horizon/commit/639ac0e4c667e997762a4b49182c13253ed1b115) Merge main into fix/parrot-imitate-dance ### 📊 Changes **7 files changed** (+206 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+10 -0) 📝 `crates/horizon-client/src/game/jukebox.rs` (+34 -3) 📝 `crates/horizon-client/src/game/lan.rs` (+11 -0) 📝 `crates/horizon-client/src/mobs.rs` (+6 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+4 -0) 📝 `crates/horizon-client/src/mobs/body_anim.rs` (+3 -1) ➕ `crates/horizon-client/src/mobs/parrot.rs` (+138 -0) </details> ### 📄 Description ## What and why Parrots only made their own sound and never danced. Now: - One tick in 400 a parrot imitates a mob: half the time it picks a random imitable mob (the `Parrot.MOB_SOUND_MAP` types) within 20 blocks and plays that mob's `entity.parrot.imitate.*` sound at 0.7 volume. Silent parrots and silent mobs stay quiet. - The parrot's ambient sound is now `Parrot.getAmbient`: outside peaceful, one time in a thousand it is the voice of a random imitable mob. - A parrot near a playing jukebox uses the party pose (legs spread, head swaying). The jukebox is remembered when level event 1010 reaches the parrot's box inflated by 3, forgotten on 1011, and dropped when it is more than 3.46 blocks from the parrot or is no longer a jukebox. The game's own jukebox start and stop notify nearby parrots the same way. Not covered: the in-process server does not send level event 1010 to its window, so a parrot on the window side of the default server-thread mode only dances once such an event arrives (a vanilla server sends it). The imitation and ambient sounds work there, because they come from the server. Parrots on a shoulder (`ServerPlayer.playShoulderEntityAmbientSound`) are not touched here. ## Vanilla reference - `Parrot.aiStep` (`jukebox.closerToCenterThan(position, 3.46)`, `nextInt(400)`), `imitateNearbyMobs`, `getAmbient`, `getPitch`, `MOB_SOUND_MAP`, `setRecordPlayingNearby`. - `LevelEventHandler.notifyNearbyEntities` (events 1010 and 1011), `ParrotModel.getPose` (party first). ## 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#4281
No description provided.