[GH-ISSUE #4034] Native mods: inventories for mod block entities (slots, hoppers, drops) #1177

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

Originally created by @Sylviromi on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4034

Originally assigned to: @Sylviromi on GitHub.

🤖 Filed by Sylviromi's AI agent (Claude Code, Claude Opus 5.5), not by Sylviromi personally.

Part of #3911 (Mods), the next server-side piece after #3996 (block entities for mod blocks). From #1854's gaps: "V, inventories (hoppers, pipes, menus, drops; per-side slot rules)", which 124 of ATM10's 307 code mods need.

Today

A mod block entity (BlockEntity::Mod) is its id and saved compound only: slots() is empty, so hoppers, droppers and comparators don't see it, and breaking the block drops nothing.

Proposal

  • Mod block entities get game-owned item slots, saved as vanilla's Items list, so hoppers, Container reads and drops on break go through the code vanilla's containers use (HopperBlockEntity, Containers.dropContents).
  • A hook for the slot count and the per-face rules (WorldlyContainer.getSlotsForFace, canPlaceItemThroughFace, canTakeItemThroughFace), so a machine takes input from the top and gives output from the bottom as a furnace does.
  • The tick hook sees the slots, so a machine can move items between them.

Out of scope: menus (opening a screen on the block) and client sync (#4028).

Checks

Round-trip of the slots through a save, and a test mod: a hopper fills a machine from above and another empties it from below; breaking it drops what's left.

Originally created by @Sylviromi on GitHub (Oct 29, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4034 Originally assigned to: @Sylviromi on GitHub. > 🤖 Filed by Sylviromi's AI agent (Claude Code, Claude Opus 5.5), not by Sylviromi personally. Part of #3911 (Mods), the next server-side piece after #3996 (block entities for mod blocks). From #1854's gaps: "V, inventories (hoppers, pipes, menus, drops; per-side slot rules)", which 124 of ATM10's 307 code mods need. ## Today A mod block entity (`BlockEntity::Mod`) is its id and saved compound only: `slots()` is empty, so hoppers, droppers and comparators don't see it, and breaking the block drops nothing. ## Proposal - Mod block entities get game-owned item slots, saved as vanilla's `Items` list, so hoppers, `Container` reads and drops on break go through the code vanilla's containers use (`HopperBlockEntity`, `Containers.dropContents`). - A hook for the slot count and the per-face rules (`WorldlyContainer.getSlotsForFace`, `canPlaceItemThroughFace`, `canTakeItemThroughFace`), so a machine takes input from the top and gives output from the bottom as a furnace does. - The tick hook sees the slots, so a machine can move items between them. Out of scope: menus (opening a screen on the block) and client sync (#4028). ## Checks Round-trip of the slots through a save, and a test mod: a hopper fills a machine from above and another empties it from below; breaking it drops what's left.
Author
Owner

@Sylviromi commented on GitHub (Oct 29, 2026):

/claim

<!-- gh-comment-id:6510361534 --> @Sylviromi commented on GitHub (Oct 29, 2026): /claim
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#1177
No description provided.