[GH-ISSUE #1332] [both singleplayer modes] Replacing a slot with air leaves a phantom occupied slot #365

Closed
opened 2026-11-02 15:38:32 +07:00 by bsakaguchi · 0 comments
Owner

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

Tested commit: 83fa14e51b89eab728b8e233e9e5d95296bef93d, explicit --no-server-thread and --server-thread, render distance 4.

  1. clear @s
  2. item replace entity @s hotbar.0 with air
  3. give @s diamond 1

Expected: the first hotbar slot is empty and receives the diamond. Native 26.3 ItemStack.isEmpty treats the air item as empty regardless of count.

Actual in both modes: slot 0 contains minecraft:air, count 1; the diamond goes into slot 1. Authoritative Inventory NBT contains that air stack. A clean control without step 2 puts the diamond in slot 0. An earlier full-inventory test also could not shift chest items into a slot supposedly cleared with air.

Hypothesis: command item replacement stores Some(air) without normalizing it to an empty slot, and insertion treats it as occupied.

Acceptance: replacing inventory/equipment slots with air clears them, and those slots accept normal items afterward.

Evidence: tools/singleplayer_sequence_audit.py --case air-slot --render-distance 4; .local/singleplayer-audit/sequence-c/air-slot-*/, plus the earlier old-mode capacity observation in sequence-a. No matching issue found.

Originally created by @rdbtCVS on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1332 Tested commit: `83fa14e51b89eab728b8e233e9e5d95296bef93d`, explicit `--no-server-thread` and `--server-thread`, render distance 4. 1. `clear @s` 2. `item replace entity @s hotbar.0 with air` 3. `give @s diamond 1` Expected: the first hotbar slot is empty and receives the diamond. Native 26.3 `ItemStack.isEmpty` treats the air item as empty regardless of count. Actual in both modes: slot 0 contains `minecraft:air`, count 1; the diamond goes into slot 1. Authoritative Inventory NBT contains that air stack. A clean control without step 2 puts the diamond in slot 0. An earlier full-inventory test also could not shift chest items into a slot supposedly cleared with air. Hypothesis: command item replacement stores `Some(air)` without normalizing it to an empty slot, and insertion treats it as occupied. Acceptance: replacing inventory/equipment slots with air clears them, and those slots accept normal items afterward. Evidence: `tools/singleplayer_sequence_audit.py --case air-slot --render-distance 4`; `.local/singleplayer-audit/sequence-c/air-slot-*/`, plus the earlier old-mode capacity observation in `sequence-a`. No matching issue found.
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#365
No description provided.