[PR #2677] [MERGED] Mob particles reach the window: ravager roar, cube landings, nautilus bubbles, wither smoke #4532

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

📋 Pull Request Information

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

Base: main ← Head: fix/mob-event-particles-to-clients


📝 Commits (3)

  • fc06585 Send mob particles to clients the way vanilla does
  • e219a40 Merge remote-tracking branch 'origin/main' into HEAD
  • 9914a8a Name the wither's client smoke tick client_smoke

📊 Changes

13 files changed (+265 additions, -72 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/creatures.rs (+14 -0)
📝 crates/horizon-client/src/game/lan_particles.rs (+34 -0)
📝 crates/horizon-client/src/game/remote.rs (+17 -17)
➕ crates/horizon-client/src/game/remote_mob_particles.rs (+50 -0)
📝 crates/horizon-client/src/mobs.rs (+10 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+6 -4)
📝 crates/horizon-client/src/mobs/cube.rs (+37 -25)
📝 crates/horizon-client/src/mobs/illusioner.rs (+41 -12)
📝 crates/horizon-client/src/mobs/nautilus.rs (+14 -5)
📝 crates/horizon-client/src/mobs/ravager.rs (+8 -1)
📝 crates/horizon-client/src/mobs/undead.rs (+13 -8)
📝 crates/horizon-client/src/mobs/wither.rs (+20 -0)

📄 Description

What and why

On the server thread (the default single player mode) the window is a client, and MobEvent::Particles only drew into the server's own particle engine, so the window never saw these mob particles. Each emitter now reaches clients the way vanilla does it:

  • Ravager roar: the server sends entity event 69. The client draws the 40 puffs (gaussian speed 0.2 from the middle of the box) and pushes its own player within 4 blocks, as Ravager.handleEntityEvent(69) does.
  • Slime, magma cube and sulfur cube landing: the client spawns the splash when the synced on-ground flag turns on (AbstractCubeMob.tick).
  • Nautilus bubbles: the client spawns them while the nautilus is in water, from its synced motion (AbstractNautilus.tick). The server copy also uses the bubble's own drawn speed now, not a random one.
  • Wither head smoke: spawned by the client (WitherBoss.aiStep).
  • Invisible illusioner: the client moves the mirror images and spawns the cloud puff when hurt and once a minute, from the synced invisible flag (Illusioner.aiStep). The server does not send that flag for mobs yet, so this works on vanilla servers for now.
  • The green sparkles of a baby that was fed to grow up faster, and the zombie egg-eating poofs: vanilla sends these with ServerLevel.sendParticles, so they are now sent as a level particles packet to the players within 32 blocks (new MobEvent::LevelParticles).

Not done here: the zombie's egg crumbs (an item particle, which the packet code cannot encode yet), the ravager stun smoke and the wolf shake splashes (they need those mobs' client animation state first), and the wither's coloured particles.

Vanilla reference

Ravager.handleEntityEvent, addRoarParticleEffects, applyRoarKnockbackClient; AbstractCubeMob.tick; AbstractNautilus.spawnBubbles; WitherBoss.aiStep; Illusioner.aiStep; AgeableMob.aiStep; RemoveBlockGoal.tick; ServerLevel.sendParticles.

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/2677 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/mob-event-particles-to-clients` --- ### 📝 Commits (3) - [`fc06585`](https://github.com/horizon-rust/horizon/commit/fc06585938b4c0a4386e3c43b7ff8352158e35df) Send mob particles to clients the way vanilla does - [`e219a40`](https://github.com/horizon-rust/horizon/commit/e219a40ebc4025853ada3a9dc45f41090da42a60) Merge remote-tracking branch 'origin/main' into HEAD - [`9914a8a`](https://github.com/horizon-rust/horizon/commit/9914a8af4113d595361cad8c02c576e4f30e1667) Name the wither's client smoke tick client_smoke ### 📊 Changes **13 files changed** (+265 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+14 -0) 📝 `crates/horizon-client/src/game/lan_particles.rs` (+34 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+17 -17) ➕ `crates/horizon-client/src/game/remote_mob_particles.rs` (+50 -0) 📝 `crates/horizon-client/src/mobs.rs` (+10 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+6 -4) 📝 `crates/horizon-client/src/mobs/cube.rs` (+37 -25) 📝 `crates/horizon-client/src/mobs/illusioner.rs` (+41 -12) 📝 `crates/horizon-client/src/mobs/nautilus.rs` (+14 -5) 📝 `crates/horizon-client/src/mobs/ravager.rs` (+8 -1) 📝 `crates/horizon-client/src/mobs/undead.rs` (+13 -8) 📝 `crates/horizon-client/src/mobs/wither.rs` (+20 -0) </details> ### 📄 Description ## What and why On the server thread (the default single player mode) the window is a client, and `MobEvent::Particles` only drew into the server's own particle engine, so the window never saw these mob particles. Each emitter now reaches clients the way vanilla does it: - **Ravager roar:** the server sends entity event 69. The client draws the 40 puffs (gaussian speed 0.2 from the middle of the box) and pushes its own player within 4 blocks, as `Ravager.handleEntityEvent(69)` does. - **Slime, magma cube and sulfur cube landing:** the client spawns the splash when the synced on-ground flag turns on (`AbstractCubeMob.tick`). - **Nautilus bubbles:** the client spawns them while the nautilus is in water, from its synced motion (`AbstractNautilus.tick`). The server copy also uses the bubble's own drawn speed now, not a random one. - **Wither head smoke:** spawned by the client (`WitherBoss.aiStep`). - **Invisible illusioner:** the client moves the mirror images and spawns the cloud puff when hurt and once a minute, from the synced invisible flag (`Illusioner.aiStep`). The server does not send that flag for mobs yet, so this works on vanilla servers for now. - **The green sparkles of a baby that was fed to grow up faster, and the zombie egg-eating poofs:** vanilla sends these with `ServerLevel.sendParticles`, so they are now sent as a level particles packet to the players within 32 blocks (new `MobEvent::LevelParticles`). Not done here: the zombie's egg crumbs (an item particle, which the packet code cannot encode yet), the ravager stun smoke and the wolf shake splashes (they need those mobs' client animation state first), and the wither's coloured particles. ## Vanilla reference `Ravager.handleEntityEvent`, `addRoarParticleEffects`, `applyRoarKnockbackClient`; `AbstractCubeMob.tick`; `AbstractNautilus.spawnBubbles`; `WitherBoss.aiStep`; `Illusioner.aiStep`; `AgeableMob.aiStep`; `RemoveBlockGoal.tick`; `ServerLevel.sendParticles`. ## 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:17:51 +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#4532
No description provided.