[PR #2125] [MERGED] Server players see villager hearts, taming hearts and smoke, spawn poofs and snowball crumbs #4026

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

📋 Pull Request Information

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

Base: main ← Head: fix/remote-entity-events


📝 Commits (4)

  • 2e91bd8 Send villager, taming, love, spawn poof and snowball entity events to server clients
  • c752c21 Merge main into fix/remote-entity-events
  • 6a56f7e Merge origin/main into fix/remote-entity-events
  • 627ab54 Merge origin/main into fix/remote-entity-events (picks up main's rabbit-arm fix, #2716)

📊 Changes

10 files changed (+135 additions, -47 deletions)

View changed files

📝 crates/horizon-client/src/game/allays.rs (+1 -1)
📝 crates/horizon-client/src/game/creatures.rs (+26 -21)
📝 crates/horizon-client/src/game/llamas.rs (+6 -0)
📝 crates/horizon-client/src/game/mounts.rs (+15 -6)
📝 crates/horizon-client/src/game/nautili.rs (+3 -6)
📝 crates/horizon-client/src/game/remote.rs (+31 -0)
📝 crates/horizon-client/src/game/spawner.rs (+10 -1)
📝 crates/horizon-client/src/game/villagers.rs (+27 -8)
📝 crates/horizon-client/src/mobs.rs (+4 -1)
📝 crates/horizon-client/src/mobs/villager_brain.rs (+12 -3)

📄 Description

What and why

Single player runs on the server thread, and the window is a client of it. Many vanilla effects are an entity event: the server sends ClientboundEntityEventPacket(entity, byte) and the client's handleEntityEvent draws the particles. Horizon's simulation drew these particles into its own particle engine, which nobody sees on the server thread, and the client's EntityEvent arm only handled 1, 3 (death), 24-28 and 35. So a window on the server thread showed no villager hearts, no taming hearts or smoke, no spawn poof and no snowball crumbs.

Now the server sends the byte where vanilla's server does, and the client draws it in handleEntityEvent's way. The simulation still draws its own copy for the in-frame game.

  • 20 (Mob): the spawn poof. The server already sent it; the client now draws it (poof_particles, split out of mob_poof).
  • 12 / 13 / 14 (Villager): hearts, angry and happy particles. Sent from VillagerMakeLove, the trade reputation and setLastHurtByMob, and from the brain events for the partner hearts and the job-site / POI happy particles. The client draws them with the existing particles::entity_event_burst table.
  • 6 / 7 (TamableAnimal, AbstractHorse): taming smoke and hearts. Sent for wolf, cat, parrot and nautilus tame attempts, for a horse that is tamed, and 6 for a horse that bucks its rider off (RunAroundLikeCrazyGoal).
  • 18 (Animal, Allay): love hearts. Sent when an animal falls in love by being fed (food, llama hay, camel and horse foods, nautilus), when a pair breeds (finalizeSpawnChildFromBreeding, sniffer included) and when an allay duplicates.
  • 3 (Snowball, ThrownEgg): break crumbs. Sent on hit; the client finds the remote projectile by id and draws the crumbs there (item_burst). The server tracker drops a projectile that has left the level in the same tick, so events for entities that are gone now go out just before the tracker runs; otherwise the client would lose the projectile before the event arrived.

Vanilla reference

  • Mob.handleEntityEvent / spawnAnim / LivingEntity.makePoofParticles (20)
  • Villager.handleEntityEvent, AbstractVillager.addParticlesAroundSelf, VillagerMakeLove, AssignProfessionFromJobSite (12, 13, 14)
  • TamableAnimal.handleEntityEvent / spawnTamingParticles, AbstractHorse.handleEntityEvent, RunAroundLikeCrazyGoal.tick (6, 7)
  • Animal.setInLove, Animal.finalizeSpawnChildFromBreeding, Animal.handleEntityEvent, Allay.duplicateAllay (18)
  • Snowball.onHit / handleEntityEvent, ThrownEgg.onHit / handleEntityEvent (3)

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/2125 **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/remote-entity-events` --- ### 📝 Commits (4) - [`2e91bd8`](https://github.com/horizon-rust/horizon/commit/2e91bd84e9ee9f0ddbca7bd9e53bdc7edd9ca0f7) Send villager, taming, love, spawn poof and snowball entity events to server clients - [`c752c21`](https://github.com/horizon-rust/horizon/commit/c752c21246378d556ed6f97ea9b395a46d9b9d40) Merge main into fix/remote-entity-events - [`6a56f7e`](https://github.com/horizon-rust/horizon/commit/6a56f7e39f2af7453c5eb0ffd3d7b3d54a2a4d0a) Merge origin/main into fix/remote-entity-events - [`627ab54`](https://github.com/horizon-rust/horizon/commit/627ab546b966dd011fea60f271bfccb408df4779) Merge origin/main into fix/remote-entity-events (picks up main's rabbit-arm fix, #2716) ### 📊 Changes **10 files changed** (+135 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/allays.rs` (+1 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+26 -21) 📝 `crates/horizon-client/src/game/llamas.rs` (+6 -0) 📝 `crates/horizon-client/src/game/mounts.rs` (+15 -6) 📝 `crates/horizon-client/src/game/nautili.rs` (+3 -6) 📝 `crates/horizon-client/src/game/remote.rs` (+31 -0) 📝 `crates/horizon-client/src/game/spawner.rs` (+10 -1) 📝 `crates/horizon-client/src/game/villagers.rs` (+27 -8) 📝 `crates/horizon-client/src/mobs.rs` (+4 -1) 📝 `crates/horizon-client/src/mobs/villager_brain.rs` (+12 -3) </details> ### 📄 Description ## What and why Single player runs on the server thread, and the window is a client of it. Many vanilla effects are an entity event: the server sends `ClientboundEntityEventPacket(entity, byte)` and the client's `handleEntityEvent` draws the particles. Horizon's simulation drew these particles into its own particle engine, which nobody sees on the server thread, and the client's `EntityEvent` arm only handled 1, 3 (death), 24-28 and 35. So a window on the server thread showed no villager hearts, no taming hearts or smoke, no spawn poof and no snowball crumbs. Now the server sends the byte where vanilla's server does, and the client draws it in `handleEntityEvent`'s way. The simulation still draws its own copy for the in-frame game. - 20 (`Mob`): the spawn poof. The server already sent it; the client now draws it (`poof_particles`, split out of `mob_poof`). - 12 / 13 / 14 (`Villager`): hearts, angry and happy particles. Sent from `VillagerMakeLove`, the trade reputation and `setLastHurtByMob`, and from the brain events for the partner hearts and the job-site / POI happy particles. The client draws them with the existing `particles::entity_event_burst` table. - 6 / 7 (`TamableAnimal`, `AbstractHorse`): taming smoke and hearts. Sent for wolf, cat, parrot and nautilus tame attempts, for a horse that is tamed, and 6 for a horse that bucks its rider off (`RunAroundLikeCrazyGoal`). - 18 (`Animal`, `Allay`): love hearts. Sent when an animal falls in love by being fed (food, llama hay, camel and horse foods, nautilus), when a pair breeds (`finalizeSpawnChildFromBreeding`, sniffer included) and when an allay duplicates. - 3 (`Snowball`, `ThrownEgg`): break crumbs. Sent on hit; the client finds the remote projectile by id and draws the crumbs there (`item_burst`). The server tracker drops a projectile that has left the level in the same tick, so events for entities that are gone now go out just before the tracker runs; otherwise the client would lose the projectile before the event arrived. ## Vanilla reference - `Mob.handleEntityEvent` / `spawnAnim` / `LivingEntity.makePoofParticles` (20) - `Villager.handleEntityEvent`, `AbstractVillager.addParticlesAroundSelf`, `VillagerMakeLove`, `AssignProfessionFromJobSite` (12, 13, 14) - `TamableAnimal.handleEntityEvent` / `spawnTamingParticles`, `AbstractHorse.handleEntityEvent`, `RunAroundLikeCrazyGoal.tick` (6, 7) - `Animal.setInLove`, `Animal.finalizeSpawnChildFromBreeding`, `Animal.handleEntityEvent`, `Allay.duplicateAllay` (18) - `Snowball.onHit` / `handleEntityEvent`, `ThrownEgg.onHit` / `handleEntityEvent` (3) ## 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:07 +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#4026
No description provided.