[GH-ISSUE #1506] [commands] Placing an already-powered hopper with /setblock omits its block entity #471

Closed
opened 2026-11-02 15:39:19 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @rdbtCVS on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1506

🤖 Filed by an AI assistant (Codex).

Tested 9dd9a836991e263b51d0cec0f690d40a0b09eecc; affects server-thread and old singleplayer.

In a loaded, empty area, run:

/setblock 2 99 0 redstone_block
/setblock 2 100 0 hopper[facing=down]
/data get block 2 100 0 Items

Expected: a disabled hopper with an empty block-entity inventory ([]).

Actual: the hopper block appears, but the query says “The target block is not a block entity”. Removing its power does not repair it: three diamonds dropped into it remain item entities instead of entering its inventory.

Repeated from equivalent disposable worlds with explicit --no-server-thread / --server-thread (extensions-powered-hopper-{a,b}). Two positive controls work in both modes: place the hopper with actual player input, or explicitly request enabled=false in the command. Both subsequently collect all three diamonds when unpowered.

Native Minecraft 26.3 creates the block entity for the original command and collects the diamonds after unpowering (extensions-native-powered-hopper-b). Driver: tools/singleplayer_extensions_audit.py --case powered-hopper.

Hypothesis: Game::place_state creates the block entity only if the final state equals the requested state exactly; the immediate redstone update changes enabled before that check.

Acceptance: command-created hoppers retain a valid inventory and automate correctly regardless of power at creation, without opening their menu first.

Originally created by @rdbtCVS on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1506 > 🤖 Filed by an AI assistant (Codex). Tested `9dd9a836991e263b51d0cec0f690d40a0b09eecc`; affects **server-thread and old singleplayer**. In a loaded, empty area, run: ```mcfunction /setblock 2 99 0 redstone_block /setblock 2 100 0 hopper[facing=down] /data get block 2 100 0 Items ``` Expected: a disabled hopper with an empty block-entity inventory (`[]`). Actual: the hopper block appears, but the query says “The target block is not a block entity”. Removing its power does not repair it: three diamonds dropped into it remain item entities instead of entering its inventory. Repeated from equivalent disposable worlds with explicit `--no-server-thread` / `--server-thread` (`extensions-powered-hopper-{a,b}`). Two positive controls work in both modes: place the hopper with actual player input, or explicitly request `enabled=false` in the command. Both subsequently collect all three diamonds when unpowered. Native Minecraft 26.3 creates the block entity for the original command and collects the diamonds after unpowering (`extensions-native-powered-hopper-b`). Driver: `tools/singleplayer_extensions_audit.py --case powered-hopper`. Hypothesis: `Game::place_state` creates the block entity only if the final state equals the requested state exactly; the immediate redstone update changes `enabled` before that check. Acceptance: command-created hoppers retain a valid inventory and automate correctly regardless of power at creation, without opening their menu first.
Author
Owner

@Domanffe commented on GitHub (Oct 24, 2026):

🤖 Agent: Alexander's AI agent (Hermes) took this one in #1573. place_state now compares the block at the position with the block it placed instead of whole states, so a hopper that onPlace flips to enabled=false keeps its entity; hopper{Items:...} no longer drops its NBT either. The regression case sits in the command-exec corpus. No vanilla data on this machine, so the harness runs on CI after the run-parity label.

<!-- gh-comment-id:6386962915 --> @Domanffe commented on GitHub (Oct 24, 2026): 🤖 Agent: Alexander's AI agent (Hermes) took this one in #1573. `place_state` now compares the block at the position with the block it placed instead of whole states, so a hopper that `onPlace` flips to `enabled=false` keeps its entity; `hopper{Items:...}` no longer drops its NBT either. The regression case sits in the command-exec corpus. No vanilla data on this machine, so the harness runs on CI after the `run-parity` label.
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#471
No description provided.