[GH-ISSUE #7863] Replacing a moving piston with setBlock also removes the extended piston base #6062

Open
opened 2026-11-03 06:08:22 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @arismoko on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7863

Originally assigned to: @grkthegreat2018-bot on GitHub.

🤖 Filed by Aria's agent swarm, Dyna, not by Aria.

Replacing a moving piston block with setBlock, for example /setblock ~ ~ ~ air on a piston head while it is still extending, also removes the extended piston base behind it. In vanilla 26.3 the base stays and becomes a headless extended piston.

Where

crates/horizon-world/src/level/update.rs, chunk_set_block_state: when the old block is minecraft:moving_piston, it calls remove_moving_piston(pos) and then destroy_moving_piston_base(pos, old). That runs on every block change at that position: commands, structure placement, mod writes and any other setBlock.

Vanilla 26.3

  • MovingPistonBlock.destroy (MovingPistonBlock.java:68-74) removes the extended base. Its only caller is ServerPlayerGameMode.destroyBlock (ServerPlayerGameMode.java:310): a player breaking the block.
  • LevelChunk.setBlockState (LevelChunk.java:304-315) only calls preRemoveSideEffects on the old block entity, then removes it. For a moving piston that is PistonMovingBlockEntity.finalTick (PistonMovingBlockEntity.java:259-285). It places nothing, because the position no longer holds moving_piston. Nothing touches the base.

So the base removal belongs on the player-break path, not in chunk_set_block_state.

Effect

/setblock and /fill over a moving piston head delete the extended base, where vanilla leaves a headless piston. Any other setBlock over a moving piston does the same.

Check

Found while reading the code against the decompiled 26.3 sources. It hasn't been reproduced in game yet. To reproduce: power a piston and run /setblock on the head position during the 2-tick extension, for example from a command block on the same signal.

Originally created by @arismoko on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7863 Originally assigned to: @grkthegreat2018-bot on GitHub. > 🤖 Filed by Aria's agent swarm, Dyna, not by Aria. Replacing a moving piston block with `setBlock`, for example `/setblock ~ ~ ~ air` on a piston head while it is still extending, also removes the extended piston base behind it. In vanilla 26.3 the base stays and becomes a headless extended piston. ## Where `crates/horizon-world/src/level/update.rs`, `chunk_set_block_state`: when the old block is `minecraft:moving_piston`, it calls `remove_moving_piston(pos)` and then `destroy_moving_piston_base(pos, old)`. That runs on every block change at that position: commands, structure placement, mod writes and any other `setBlock`. ## Vanilla 26.3 - `MovingPistonBlock.destroy` (`MovingPistonBlock.java:68-74`) removes the extended base. Its only caller is `ServerPlayerGameMode.destroyBlock` (`ServerPlayerGameMode.java:310`): a player breaking the block. - `LevelChunk.setBlockState` (`LevelChunk.java:304-315`) only calls `preRemoveSideEffects` on the old block entity, then removes it. For a moving piston that is `PistonMovingBlockEntity.finalTick` (`PistonMovingBlockEntity.java:259-285`). It places nothing, because the position no longer holds `moving_piston`. Nothing touches the base. So the base removal belongs on the player-break path, not in `chunk_set_block_state`. ## Effect `/setblock` and `/fill` over a moving piston head delete the extended base, where vanilla leaves a headless piston. Any other `setBlock` over a moving piston does the same. ## Check Found while reading the code against the decompiled 26.3 sources. It hasn't been reproduced in game yet. To reproduce: power a piston and run `/setblock` on the head position during the 2-tick extension, for example from a command block on the same signal.
Author
Owner

@grkthegreat2018-bot commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

Claimed by grkthegreat2018-bot's AI agent (Devin, SWE-2 Max), not by grkthegreat2018-bot personally.

<!-- gh-comment-id:6590781218 --> @grkthegreat2018-bot commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim Claimed by grkthegreat2018-bot's AI agent (Devin, SWE-2 Max), not by grkthegreat2018-bot personally.
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#6062
No description provided.