Skip to content

Is it possible to detect slots with item restrictions in Inventory peripherals? #1790

Answered by SquidDev
fechan asked this question in Q&A
Discussion options

You must be logged in to vote

Sadly there isn't really a generic way to do this. Minecraft doesn't expose any information about what items can be inserted into a slot, so the only way you can do it is to try and see.

If no items in the origin inventory can go into the destination inventory, then there would be up to NxM failed pushItem calls, where N and M are the sizes of the origin and destination inventories respectively.

I don't think this is too bad. Typically M is going to be small - things like brewing stands or furnaces are only a couple of slots. I guess if you have a chest full of items, you'd have to try $5 \times 27 = 135$ different combinations (though note you could do some of these in parallel) — mayb…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@fechan
Comment options

@SquidDev
Comment options

Answer selected by fechan
@fechan
Comment options

@SirEdvin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants