[PR #2554] [MERGED] Mobs are pushed by flowing water and lava #4422

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

📋 Pull Request Information

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

Base: main ← Head: fix/2549-mob-water-push


📝 Commits (3)

  • 9266e0c Mobs are pushed by flowing water and lava
  • a19cad2 A mob jumps out of a fluid only where Entity.isFree allows: no liquid in the box
  • 42cff7b Merge main into fix/2549-mob-water-push

📊 Changes

4 files changed (+126 additions, -0 deletions)

View changed files

📝 crates/horizon-client/examples/probe/mob_ai_probe.rs (+1 -0)
📝 crates/horizon-client/src/game/creatures.rs (+1 -0)
📝 crates/horizon-client/src/mobs.rs (+2 -0)
📝 crates/horizon-client/src/mobs/living.rs (+122 -0)

📄 Description

What and why

Mobs standing in flowing water or lava were never pushed by the current. Only the player, items, arrows and TNT had the push, so a zombie in a water stream stayed in place (or crept away only through its own pathing).

The mob fluid update only measured how deep the mob was and never added the flow vector to its velocity. It now sums the flow of every water and lava block the mob touches (scaled down in thin layers), normalises it and adds it to the velocity, with vanilla's 0.014 for water and 0.0023333 for lava (0.007 in the Nether) and the minimum 0.0045 nudge for a mob that is almost still. It runs from the same place as the other fluid updates, so it happens once per tick before the mob moves, on the server thread in single player. Water animals, turtles, axolotls, frogs, tadpoles and nautiluses are not pushed, as in vanilla.

Fixes #2549.

Vanilla reference

  • Entity.updateFluidInteraction / EntityFluidInteraction.update and applyCurrentTo
  • EntityFluidInteraction.CurrentAccumulator.applyTo
  • Entity.isPushedByFluid and its overrides (WaterAnimal, AgeableWaterCreature, Turtle, Axolotl, Frog, AbstractNautilus)

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/2554 **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/2549-mob-water-push` --- ### 📝 Commits (3) - [`9266e0c`](https://github.com/horizon-rust/horizon/commit/9266e0c7c9b3e633971555657aafe033b9ba3c1f) Mobs are pushed by flowing water and lava - [`a19cad2`](https://github.com/horizon-rust/horizon/commit/a19cad22cb4efc178809343a4fb1b5df6298805c) A mob jumps out of a fluid only where Entity.isFree allows: no liquid in the box - [`42cff7b`](https://github.com/horizon-rust/horizon/commit/42cff7bbc2a69314d9fc63d1e496365dd1040d60) Merge main into fix/2549-mob-water-push ### 📊 Changes **4 files changed** (+126 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/mob_ai_probe.rs` (+1 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/living.rs` (+122 -0) </details> ### 📄 Description ## What and why Mobs standing in flowing water or lava were never pushed by the current. Only the player, items, arrows and TNT had the push, so a zombie in a water stream stayed in place (or crept away only through its own pathing). The mob fluid update only measured how deep the mob was and never added the flow vector to its velocity. It now sums the flow of every water and lava block the mob touches (scaled down in thin layers), normalises it and adds it to the velocity, with vanilla's 0.014 for water and 0.0023333 for lava (0.007 in the Nether) and the minimum 0.0045 nudge for a mob that is almost still. It runs from the same place as the other fluid updates, so it happens once per tick before the mob moves, on the server thread in single player. Water animals, turtles, axolotls, frogs, tadpoles and nautiluses are not pushed, as in vanilla. Fixes #2549. ## Vanilla reference - `Entity.updateFluidInteraction` / `EntityFluidInteraction.update` and `applyCurrentTo` - `EntityFluidInteraction.CurrentAccumulator.applyTo` - `Entity.isPushedByFluid` and its overrides (`WaterAnimal`, `AgeableWaterCreature`, `Turtle`, `Axolotl`, `Frog`, `AbstractNautilus`) ## 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: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#4422
No description provided.