[PR #6820] [MERGED] Mobs walking into a minecart now push it #7114

Closed
opened 2026-11-03 06:34:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6820
Author: @DUzzL
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/6776-mobs-push-minecart


📝 Commits (1)

  • 57627e6 Mobs walking into a minecart push it

📊 Changes

1 file changed (+62 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/minecarts.rs (+62 -0)

📄 Description

🤖 Opened by DUzzL's AI agent (Claude Code), not by DUzzL himself.

Fixes #6776

Mobs that walk into a minecart now push it, as in vanilla. Before, only players could: the cart push in push_carts had no path for mobs, so a villager walked straight into the cart's box and the cart stayed at speed 0.

Vanilla followed: LivingEntity.pushEntities -> doPush -> AbstractMinecart.push(Entity). The cart loses 0.1 * 0.5 / distance (capped at 1/distance, along the line from cart to mob) and the mob gets a quarter of that back through Entity.push (only if it is pushable and carries nobody). Bats push nothing (Bat.pushEntities); a mob riding the cart does not push it (hasPassenger); team collision rules apply (EntitySelector.pushableBy).

Numbers: vanilla (issue): cart speed 0.050, 0.075, 0.088, ... 0.100 per tick under a walking villager. Horizon before: 0.000. After: the first tick's push is exactly 0.050 (unit test mob_walking_into_a_cart_pushes_it_by_a_twentieth, villager at x=0.13, cart at x=0.5); the later ticks follow from the existing cart friction and the repeated push.

Not verified: I did not run the full 10-tick scenario in the game, and there is no new parity harness (only the unit test). Please run the minecart harnesses in CI.

pr_ready (from the run before the final rebase onto 848a87b73): scope 1 file +62, clippy pass, doc tests, mod API pass. Failures not caused by this change: game::native_hooks::tests::native_ingredient_stays_hookable panics (native_hooks.rs:6494), and Python test_world_input_capture.test_capture_lifecycle (capture.exe exit 101). rustfmt failed on my first version and is fixed in the pushed commit. Parity: 176 affected harnesses, the local run took 34 min and reported a failure that I could not break down; left to CI.


🔄 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/6820 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6776-mobs-push-minecart` --- ### 📝 Commits (1) - [`57627e6`](https://github.com/horizon-rust/horizon/commit/57627e6fce8a64323fede103c0b3478ff8be1c9b) Mobs walking into a minecart push it ### 📊 Changes **1 file changed** (+62 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/minecarts.rs` (+62 -0) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent (Claude Code), not by DUzzL himself. Fixes #6776 Mobs that walk into a minecart now push it, as in vanilla. Before, only players could: the cart push in `push_carts` had no path for mobs, so a villager walked straight into the cart's box and the cart stayed at speed 0. **Vanilla followed:** `LivingEntity.pushEntities` -> `doPush` -> `AbstractMinecart.push(Entity)`. The cart loses `0.1 * 0.5 / distance` (capped at 1/distance, along the line from cart to mob) and the mob gets a quarter of that back through `Entity.push` (only if it is pushable and carries nobody). Bats push nothing (`Bat.pushEntities`); a mob riding the cart does not push it (`hasPassenger`); team collision rules apply (`EntitySelector.pushableBy`). **Numbers:** vanilla (issue): cart speed 0.050, 0.075, 0.088, ... 0.100 per tick under a walking villager. Horizon before: 0.000. After: the first tick's push is exactly 0.050 (unit test `mob_walking_into_a_cart_pushes_it_by_a_twentieth`, villager at x=0.13, cart at x=0.5); the later ticks follow from the existing cart friction and the repeated push. **Not verified:** I did not run the full 10-tick scenario in the game, and there is no new parity harness (only the unit test). Please run the minecart harnesses in CI. **pr_ready** (from the run before the final rebase onto 848a87b73): scope 1 file +62, clippy pass, doc tests, mod API pass. Failures not caused by this change: `game::native_hooks::tests::native_ingredient_stays_hookable` panics (`native_hooks.rs:6494`), and Python `test_world_input_capture.test_capture_lifecycle` (capture.exe exit 101). rustfmt failed on my first version and is fixed in the pushed commit. Parity: 176 affected harnesses, the local run took 34 min and reported a failure that I could not break down; left to CI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:34:08 +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#7114
No description provided.