Skip to content

Inventory shift API - #1

Merged
TheNick24 merged 4 commits into
mainfrom
feat/457-inventory-shift
Aug 3, 2026
Merged

TheNick24 merged 4 commits into
mainfrom
feat/457-inventory-shift

Conversation

@Bloeckchengrafik

@Bloeckchengrafik Bloeckchengrafik commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

Something we've noticed is the following: Implementing shift-click into the block inventories is a large hassle we'd like to avoid to re-implement in all menus. The main pain-point is Shift-click filtering:
When shift-clicking into a slot, there is no way of knowing where the item ends up and to re-route it or just block some slots. To do that, large parts of the inventory code need to be overridden with new behaviour, even though this is generally a often-desired feature in both vanilla inventories and custom menus that interact with items, such as machines.

Also, the rules for shift-clicking and normal item deposition differ sometimes, for example on the input field of the furnace. You may not shift-click fuels into the input slot, but you can put it in using a normal click.

Our solution for this is rule-based, see the implementation and docs for more details. Here's the proposition text:

Variant 2 is some sort of SlotRule that can be attached to a slot in an inventory. This rule declares interaction with > the slot, might it be just normal item deposition, shift-click interaction and more. This could also have advantages > for custom chest menus due to defining a local api for processing clicks without relying on a filtered event or similar. Drawback is that this not as easily composable as the event-based solution and that it would be quite the large change encompassing more than this feature request (feels like scope creep).

@Bloeckchengrafik Bloeckchengrafik changed the title Feat/457 inventory shift Inventory shift API Aug 3, 2026
@TheNick24
TheNick24 merged commit 55b09d7 into main Aug 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants