[GH-ISSUE #2556] pistons do not push entities #648

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

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

What I did: put a skeleton in front of a piston and powered it. Also put the player (me) in front of a piston and powered it
What happened: The piston head phased through me and the skeleton without pushing it
What I expected: In both examples, the piston should have pushed the entity
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/2556 > What I did: put a skeleton in front of a piston and powered it. Also put the player (me) in front of a piston and powered it > What happened: The piston head phased through me and the skeleton without pushing it > What I expected: In both examples, the piston should have pushed the entity > 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/1564408760582017214) Tags: gameplay **Attachments** (Discord links expire after a while; the thread keeps them) - [2026-10-26_22.36.53.png](https://cdn.discordapp.com/attachments/1564408760582017214/1564408761282461887/2026-10-26_22.36.53.png?ex=6ae128b1&is=6adfd731&hm=5e811d29bc6e4b7a82aaca08218472301b760164332c79cb6beb270623c7cd01&) <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:48 +07:00
Author
Owner

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

This looks like the same bug that open PR #2482 (push players and entities with moving pistons) fixes.

<!-- gh-comment-id:6429393565 --> @kacpherek commented on GitHub (Oct 26, 2026): This looks like the same bug that open PR #2482 (push players and entities with moving pistons) fixes.
Author
Owner

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

🤖 Agent: this is what the open pull request #2482 ("Push players and entities with moving pistons", branch fix/piston-entity-push on the fork) does. The report says the piston head passes through the player and the skeleton without pushing them; that is the missing piston push, and the pull request implements it the way vanilla does.

What vanilla does

A moving piston's head pushes the entities in its way in PistonMovingBlockEntity.moveCollidedEntities: the entities in front of the moved block are pushed along the push axis (and the slime block's causeBounce branch bounces them). The pushed body is then moved with Entity.limitPistonMovement, so it stops at a wall instead of passing through it, and fixEntityWithinPistonBase puts a body that was pushed into the piston's base back where it belongs.

What the pull request does

The pushed movement resolves against the world border as well, the way ordinary movement does: Entity.move collects the border's walls in collectCollidersIgnoringWorldBorder whenever WorldBorder.isInsideCloseToBorder holds, so a body pushed into the border's wall now stops there instead of being pushed through it.

Proof

The piston-push LAN check (two real games over LAN, host and guest, both host paths) covers a stationary player, a guest, a mob and a player with the inventory open, and the piston-slime case covers the slime block's push and bounce:

[lan] piston-push: PASS {'Player24725': 0.05, 'Guest': 0.05, 'inventory': 0.66, 'pig': 0.81, 'border': [...]}

The branch also carries the regression tests for the border's wall and the slime push, and the piston_push / piston_movement / piston_shape parity harnesses pass against both 26.3 jars.

The issue stays open here: the account cannot close upstream issues, so the maintainer has the last word.

<!-- gh-comment-id:6434444830 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: this is what the open pull request #2482 ("Push players and entities with moving pistons", branch `fix/piston-entity-push` on the fork) does. The report says the piston head passes through the player and the skeleton without pushing them; that is the missing piston push, and the pull request implements it the way vanilla does. **What vanilla does** A moving piston's head pushes the entities in its way in `PistonMovingBlockEntity.moveCollidedEntities`: the entities in front of the moved block are pushed along the push axis (and the slime block's `causeBounce` branch bounces them). The pushed body is then moved with `Entity.limitPistonMovement`, so it stops at a wall instead of passing through it, and `fixEntityWithinPistonBase` puts a body that was pushed into the piston's base back where it belongs. **What the pull request does** The pushed movement resolves against the world border as well, the way ordinary movement does: `Entity.move` collects the border's walls in `collectCollidersIgnoringWorldBorder` whenever `WorldBorder.isInsideCloseToBorder` holds, so a body pushed into the border's wall now stops there instead of being pushed through it. **Proof** The `piston-push` LAN check (two real games over LAN, host and guest, both host paths) covers a stationary player, a guest, a mob and a player with the inventory open, and the `piston-slime` case covers the slime block's push and bounce: ``` [lan] piston-push: PASS {'Player24725': 0.05, 'Guest': 0.05, 'inventory': 0.66, 'pig': 0.81, 'border': [...]} ``` The branch also carries the regression tests for the border's wall and the slime push, and the `piston_push` / `piston_movement` / `piston_shape` parity harnesses pass against both 26.3 jars. The issue stays open here: the account cannot close upstream issues, so the maintainer has the last word.
Author
Owner

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

🤖 Agent: this is already fixed by the merged pull request
https://github.com/ludovic111/horizon/pull/2482 ("Push players and entities
with moving pistons", merged into main).

The piston push now pushes players and mobs (the slime bounce and the world
border's wall included), so a piston no longer extends through a stationary
player. The checks that were run for that branch:

Check Result
python3 tools/lan_e2e.py --bin-dir target/fast --check piston-push --check piston-slime ✅ both passed
python3 tools/parity.py piston_push piston_movement piston_shape ✅ 3 passed, 0 failed
cargo test -p horizon-client --lib -- border_movement_tests ✅ 2 passed
cargo test -p horizon-client --bin horizon-client -- game::piston_push::tests ✅ 2 passed
cargo fmt -p horizon-client ✅
python3 tools/check_public_tree.py ✅

and, from tools/pr_ready.py --quick on that branch: Python tests ✅ 325
passed (17 s), horizon-client and horizon-world tests ✅ 1548 passed
(3 min 57 s), clippy ✅ (1 min 44 s), rustfmt ✅ (4 s), Cargo.lock ✅
unchanged, public tree ✅ (parity was left to CI: 268 affected harnesses).

Vanilla followed there: PistonMovingBlockEntity.tick, moveCollidedEntities,
moveStuckEntities, moveEntityByPiston, fixEntityWithinPistonBase and
Entity.limitPistonMovement, with the slime bounce in moveCollidedEntities
and the world border's walls in Entity.collectCollidersIgnoringWorldBorder.

Projectiles, TNT and the other entity types that a piston does not push are
outside that change.

<!-- gh-comment-id:6440262261 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: this is already fixed by the merged pull request https://github.com/ludovic111/horizon/pull/2482 ("Push players and entities with moving pistons", merged into `main`). The piston push now pushes players and mobs (the slime bounce and the world border's wall included), so a piston no longer extends through a stationary player. The checks that were run for that branch: | Check | Result | | --- | --- | | `python3 tools/lan_e2e.py --bin-dir target/fast --check piston-push --check piston-slime` | ✅ both passed | | `python3 tools/parity.py piston_push piston_movement piston_shape` | ✅ 3 passed, 0 failed | | `cargo test -p horizon-client --lib -- border_movement_tests` | ✅ 2 passed | | `cargo test -p horizon-client --bin horizon-client -- game::piston_push::tests` | ✅ 2 passed | | `cargo fmt -p horizon-client` | ✅ | | `python3 tools/check_public_tree.py` | ✅ | and, from `tools/pr_ready.py --quick` on that branch: Python tests ✅ 325 passed (17 s), `horizon-client` and `horizon-world` tests ✅ 1548 passed (3 min 57 s), clippy ✅ (1 min 44 s), rustfmt ✅ (4 s), Cargo.lock ✅ unchanged, public tree ✅ (parity was left to CI: 268 affected harnesses). Vanilla followed there: `PistonMovingBlockEntity.tick`, `moveCollidedEntities`, `moveStuckEntities`, `moveEntityByPiston`, `fixEntityWithinPistonBase` and `Entity.limitPistonMovement`, with the slime bounce in `moveCollidedEntities` and the world border's walls in `Entity.collectCollidersIgnoringWorldBorder`. Projectiles, TNT and the other entity types that a piston does not push are outside that change.
Author
Owner

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

🤖 Agent: Covered by open PR #2482 (piston entity pushing).

<!-- gh-comment-id:6443364635 --> @socksprox commented on GitHub (Oct 27, 2026): 🤖 Agent: Covered by open PR #2482 (piston entity pushing).
Author
Owner

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

Fixed by #2482: pistons now push players and mobs.

<!-- gh-comment-id:6453968196 --> @kacpherek commented on GitHub (Oct 27, 2026): Fixed by #2482: pistons now push players and mobs.
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#648
No description provided.