[PR #2540] [MERGED] Sync mob variants and looks to the single player window #4412

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

📋 Pull Request Information

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

Base: main ← Head: fix/sync-mob-variants


📝 Commits (10+)

  • d248ab2 Give foxes their own goals: flee, hunt, nap in the shade and eat berries
  • 94600b2 Format the fox module order
  • 25c53cc Server-thread clients animate ravager, hoglin, iron golem, creaking, vex, allay, axolotl, guardian, copper golem and strider
  • 11e1ff1 Let armadillos roll up when scared, peek out and take less damage as a ball
  • 8144385 Give foxes their stalk, pounce, faceplant, shelter and perch states
  • 29754b8 Merge origin/main into feat/fox-states
  • 5e27fd3 Use the mob level event that main already has
  • 04b0b9a Let frogs croak, shoot their tongue at small slimes and idle-swim
  • 140958f Sync the variants and looks of server mobs to the window
  • 400d9e6 Show goats' lost horns and let them lower their head and ram

📊 Changes

34 files changed (+4271 additions, -106 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+2 -0)
📝 crates/horizon-client/src/entity_nbt.rs (+17 -0)
📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/client_ambient.rs (+1 -0)
📝 crates/horizon-client/src/game/creatures.rs (+42 -2)
📝 crates/horizon-client/src/game/lan.rs (+254 -0)
📝 crates/horizon-client/src/game/lan_mobs.rs (+6 -0)
📝 crates/horizon-client/src/game/mob_blocks.rs (+7 -5)
➕ crates/horizon-client/src/game/pandas.rs (+165 -0)
📝 crates/horizon-client/src/game/remote.rs (+50 -3)
📝 crates/horizon-client/src/game/remote_mob_data.rs (+137 -2)
📝 crates/horizon-client/src/mobs.rs (+33 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+59 -15)
📝 crates/horizon-client/src/mobs/allay.rs (+5 -0)
➕ crates/horizon-client/src/mobs/armadillo.rs (+407 -0)
📝 crates/horizon-client/src/mobs/bee.rs (+11 -0)
📝 crates/horizon-client/src/mobs/body_anim.rs (+7 -7)
📝 crates/horizon-client/src/mobs/control.rs (+17 -1)
📝 crates/horizon-client/src/mobs/copper_golem.rs (+12 -2)
📝 crates/horizon-client/src/mobs/creaking.rs (+49 -21)

...and 14 more files

📄 Description

What and why

In single player the window is a client of its own server, so its mobs are built only from SetEntityData. mob_meta sent only some species' data, and remote_mob_data::apply decoded even less. Now the server sends and the client reads these entries (vanilla 26.3 indices):

Sent by the server and now read by the client:

  • Horse variant and markings (19). The server already sent it; the client ignored it.
  • Llama and trader llama: chest (19), strength (20), variant (21). Donkey and mule chest (19).
  • Cat variant (20) and wolf variant (23). The server already sent them; the client ignored them.
  • Wolf anger end time (22), so an angry wolf shows its angry texture.

Missing on both sides, now synced:

  • Frog (18), cow (18), chicken (18), pig (19) and zombie nautilus (21) variants, as registry ids.
  • Axolotl variant (18), fox type (18), rabbit type (18), parrot variant (20), panda main and hidden gene (21, 22).
  • Tropical fish pattern and colours (17, packed), salmon size (17), pufferfish puff state (17).
  • Copper golem weather state (16).
  • Bee flags (18: nectar, stung, rolling) and anger end time (19).
  • Ghast charging (16) and the wither's invulnerable ticks (19).

Already in place before this PR: sheep colour and sheared, villager and zombie villager data, slime size, creeper powered and ignited, painting variant, wolf and cat collar, tame flags. Skipped because other PRs cover them: mooshroom and snow golem (#2462), shulker, sniffer, camel and others (#2528, #2533), goat horns (#2417).

The fox, panda, rabbit, parrot, axolotl and salmon renderers do not read these fields yet (mobs/render.rs body), in single player or not. The data now arrives in the same extra.variant fields that spawning and NBT use, so a renderer only has to read them.

Vanilla reference

Axolotl, Frog, Fox, Panda, Rabbit, Parrot, Llama, Horse, AbstractChestedHorse, Cat, Wolf, TropicalFish, Salmon, Pufferfish, CopperGolem, Bee, Pig, Cow, Chicken, ZombieNautilus, Ghast and WitherBoss defineSynchedData entries, and EntityDataSerializers (the variants are holderRegistry ids, the weather state an enum ordinal).

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/2540 **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/sync-mob-variants` --- ### 📝 Commits (10+) - [`d248ab2`](https://github.com/horizon-rust/horizon/commit/d248ab26057306cdca68f68541a5af915e1edf11) Give foxes their own goals: flee, hunt, nap in the shade and eat berries - [`94600b2`](https://github.com/horizon-rust/horizon/commit/94600b266f46779b592f5441d1f2549cf51b27cb) Format the fox module order - [`25c53cc`](https://github.com/horizon-rust/horizon/commit/25c53cc80330575cf822d2718ca9a0c4afbc3587) Server-thread clients animate ravager, hoglin, iron golem, creaking, vex, allay, axolotl, guardian, copper golem and strider - [`11e1ff1`](https://github.com/horizon-rust/horizon/commit/11e1ff12d0c516f3300c7919babfd4f66fc15131) Let armadillos roll up when scared, peek out and take less damage as a ball - [`8144385`](https://github.com/horizon-rust/horizon/commit/8144385ce6e352754002857f970c988ae5b46e6d) Give foxes their stalk, pounce, faceplant, shelter and perch states - [`29754b8`](https://github.com/horizon-rust/horizon/commit/29754b857d3f5a2b8c464b96a00b7d40dd0c82de) Merge origin/main into feat/fox-states - [`5e27fd3`](https://github.com/horizon-rust/horizon/commit/5e27fd342166040e1cc464e88c059e078534f86a) Use the mob level event that main already has - [`04b0b9a`](https://github.com/horizon-rust/horizon/commit/04b0b9aed5eb24f99bf88185560238bd40330bf2) Let frogs croak, shoot their tongue at small slimes and idle-swim - [`140958f`](https://github.com/horizon-rust/horizon/commit/140958fa58e766216a886730a66265f8e3dd11e2) Sync the variants and looks of server mobs to the window - [`400d9e6`](https://github.com/horizon-rust/horizon/commit/400d9e61157d13ca60a50847180892474ce34cc0) Show goats' lost horns and let them lower their head and ram ### 📊 Changes **34 files changed** (+4271 additions, -106 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+2 -0) 📝 `crates/horizon-client/src/entity_nbt.rs` (+17 -0) 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/client_ambient.rs` (+1 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+42 -2) 📝 `crates/horizon-client/src/game/lan.rs` (+254 -0) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+6 -0) 📝 `crates/horizon-client/src/game/mob_blocks.rs` (+7 -5) ➕ `crates/horizon-client/src/game/pandas.rs` (+165 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+50 -3) 📝 `crates/horizon-client/src/game/remote_mob_data.rs` (+137 -2) 📝 `crates/horizon-client/src/mobs.rs` (+33 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+59 -15) 📝 `crates/horizon-client/src/mobs/allay.rs` (+5 -0) ➕ `crates/horizon-client/src/mobs/armadillo.rs` (+407 -0) 📝 `crates/horizon-client/src/mobs/bee.rs` (+11 -0) 📝 `crates/horizon-client/src/mobs/body_anim.rs` (+7 -7) 📝 `crates/horizon-client/src/mobs/control.rs` (+17 -1) 📝 `crates/horizon-client/src/mobs/copper_golem.rs` (+12 -2) 📝 `crates/horizon-client/src/mobs/creaking.rs` (+49 -21) _...and 14 more files_ </details> ### 📄 Description ## What and why In single player the window is a client of its own server, so its mobs are built only from SetEntityData. `mob_meta` sent only some species' data, and `remote_mob_data::apply` decoded even less. Now the server sends and the client reads these entries (vanilla 26.3 indices): Sent by the server and now read by the client: - Horse variant and markings (19). The server already sent it; the client ignored it. - Llama and trader llama: chest (19), strength (20), variant (21). Donkey and mule chest (19). - Cat variant (20) and wolf variant (23). The server already sent them; the client ignored them. - Wolf anger end time (22), so an angry wolf shows its angry texture. Missing on both sides, now synced: - Frog (18), cow (18), chicken (18), pig (19) and zombie nautilus (21) variants, as registry ids. - Axolotl variant (18), fox type (18), rabbit type (18), parrot variant (20), panda main and hidden gene (21, 22). - Tropical fish pattern and colours (17, packed), salmon size (17), pufferfish puff state (17). - Copper golem weather state (16). - Bee flags (18: nectar, stung, rolling) and anger end time (19). - Ghast charging (16) and the wither's invulnerable ticks (19). Already in place before this PR: sheep colour and sheared, villager and zombie villager data, slime size, creeper powered and ignited, painting variant, wolf and cat collar, tame flags. Skipped because other PRs cover them: mooshroom and snow golem (#2462), shulker, sniffer, camel and others (#2528, #2533), goat horns (#2417). The fox, panda, rabbit, parrot, axolotl and salmon renderers do not read these fields yet (`mobs/render.rs` `body`), in single player or not. The data now arrives in the same `extra.variant` fields that spawning and NBT use, so a renderer only has to read them. ## Vanilla reference `Axolotl`, `Frog`, `Fox`, `Panda`, `Rabbit`, `Parrot`, `Llama`, `Horse`, `AbstractChestedHorse`, `Cat`, `Wolf`, `TropicalFish`, `Salmon`, `Pufferfish`, `CopperGolem`, `Bee`, `Pig`, `Cow`, `Chicken`, `ZombieNautilus`, `Ghast` and `WitherBoss` `defineSynchedData` entries, and `EntityDataSerializers` (the variants are `holderRegistry` ids, the weather state an enum ordinal). ## 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:58 +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#4412
No description provided.