[GH-ISSUE #2549] Mobs not correctly affected by flowing water #645

Closed
opened 2026-11-02 15:40:46 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @ludovic111 on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2549

What I did: put a zombie in flowing water, once with a villager next to it and another without
What happened: With the villager next to the zombie, the zombie tried to path to the villager and remained stuck. Without the villager, the zombie remained in the same spot for around 10 seconds, then started slowly being pushed by the water
What I expected: In both examples, the zombie should have been pushed by the water regardless of whether a villager was there or not
Horizon version: 0.2.75
OS, CPU, GPU: MacOS M2

Reported on Discord by DarkCows in #horizon-bugs · Discord thread
Tags: gameplay

Attachments (Discord links expire after a while; the thread keeps them)

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @ludovic111 on GitHub (Oct 26, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2549 > What I did: put a zombie in flowing water, once with a villager next to it and another without > What happened: With the villager next to the zombie, the zombie tried to path to the villager and remained stuck. Without the villager, the zombie remained in the same spot for around 10 seconds, then started slowly being pushed by the water > What I expected: In both examples, the zombie should have been pushed by the water regardless of whether a villager was there or not > Horizon version: 0.2.75 > OS, CPU, GPU: MacOS M2 Reported on Discord by **DarkCows** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1564402764921180201) Tags: gameplay **Attachments** (Discord links expire after a while; the thread keeps them) - [2026-10-26_22.15.52.png](https://cdn.discordapp.com/attachments/1564402764921180201/1564402765516505198/2026-10-26_22.15.52.png?ex=6ae1231c&is=6adfd19c&hm=3003e328833fc8d86b1062a1a47cf65513b33c41f95497db417e59b7941e629e&) <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
bsakaguchi 2026-11-02 15:40:46 +07:00
Author
Owner

@kacpherek commented on GitHub (Oct 26, 2026):

Thanks DarkCows for the report! A fix is up in #2554: mobs standing in flowing water or lava are now pushed by the current like in vanilla. It's waiting for review.

<!-- gh-comment-id:6428932848 --> @kacpherek commented on GitHub (Oct 26, 2026): Thanks DarkCows for the report! A fix is up in #2554: mobs standing in flowing water or lava are now pushed by the current like in vanilla. It's waiting for review.
Author
Owner

@levzzz5154 commented on GitHub (Oct 27, 2026):

🤖 Agent: fixed on the fork branch fix/flowing-water-mobs (open pull request against this repository, "Carry mobs along with a fluid current").

What vanilla does: 26.3 has no FlowingFluid#applyFlowTo and no Entity#getFluidFalling any more. The current lives in EntityFluidInteraction; Entity#updateFluidInteraction (Entity.java:1678-1700) drives it every tick, applying the water current with the scale 0.014 and the lava one with 0.007 (0.00233 without the fast lava dimension attribute), and CurrentAccumulator#applyTo (EntityFluidInteraction.java:210-228) adds the average of the flow vectors for a player and the normalized direction for any other body. The flow vector is FlowingFluid#getFlow (FlowingFluid.java:54-101). Horizon had all of that in crates/horizon-world/src/entity_fluid.rs, entity_fluid_tick.rs and fluid_flow.rs, but only the player, the dropped items, the arrows and the primed TNT called it; the mobs used a reduced fluid model of their own and never felt a current.

Evidence on the branch: the new flow-push LAN case (tools/lan_e2e.py) puts a mob in a flowing water block and a second one in a pool of still sources, and checks that only the mob in the current is carried along:

$ python3 tools/lan_e2e.py --bin-dir target/fast --check flow-push
[lan] flow-push: PASS {'flowing': 2.417, 'still': 0.0}

The mob in the current is carried 2.4 blocks along the flow, the one in the still pool 0.0: without the current the two would be the same, so the case fails without the fix.

The pull request body carries "Fixes #2549".

<!-- gh-comment-id:6439873270 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: fixed on the fork branch `fix/flowing-water-mobs` (open pull request against this repository, "Carry mobs along with a fluid current"). **What vanilla does**: 26.3 has no `FlowingFluid#applyFlowTo` and no `Entity#getFluidFalling` any more. The current lives in `EntityFluidInteraction`; `Entity#updateFluidInteraction` (Entity.java:1678-1700) drives it every tick, applying the water current with the scale 0.014 and the lava one with 0.007 (0.00233 without the fast lava dimension attribute), and `CurrentAccumulator#applyTo` (EntityFluidInteraction.java:210-228) adds the *average* of the flow vectors for a player and the *normalized* direction for any other body. The flow vector is `FlowingFluid#getFlow` (FlowingFluid.java:54-101). Horizon had all of that in `crates/horizon-world/src/entity_fluid.rs`, `entity_fluid_tick.rs` and `fluid_flow.rs`, but only the player, the dropped items, the arrows and the primed TNT called it; the mobs used a reduced fluid model of their own and never felt a current. **Evidence on the branch**: the new `flow-push` LAN case (`tools/lan_e2e.py`) puts a mob in a flowing water block and a second one in a pool of still sources, and checks that only the mob in the current is carried along: ``` $ python3 tools/lan_e2e.py --bin-dir target/fast --check flow-push [lan] flow-push: PASS {'flowing': 2.417, 'still': 0.0} ``` The mob in the current is carried 2.4 blocks along the flow, the one in the still pool 0.0: without the current the two would be the same, so the case fails without the fix. The pull request body carries "Fixes #2549".
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#645
No description provided.