Item Pick from Shulkerbox
Astronomy20 opened this issue · 8 comments
In one of the constructions in my world, which required many different blocks, I had to use many shulker boxes and place them on the ground. I was wondering if it's possible to introduce/modify the function that allows you to retrieve items from the inventories of shulker boxes, similar to how it works with the player's inventory with the easyplaceMode.
I made a mod based on xisumas idea of being quickly able to swap to similar items, even when in shulkers inside the inventory. And a later request was making that work with pick block, also on litematica holograms. So yes, you can pick block litematica hologram blocks from shulkers with it(assuming the server supports it).
The server manages all the world data, including player inventories. The client can't just modify a shulker box item in the player inventory directly (well it can on the client side ofc... but that doesn't accomplish anything except a desynced inventory). If it could, then any client (mod) could just fill the boxes with whatever items you want. It would be an obvious easy exploit.
So if you have a mod that allows taking out or putting in items to the boxes directly in the inventory, then it needs a server side component that handles doing it on the server side, where the actual player inventory is stored.
Ok fantastic! Now I just want to know why need the server support for interact with shulkerbox inventory. It’s like a game feature?
It's not possible to directly take items out of shulker boxes in the player inventory in a client side mod (except of course in single player, where the mod has access to the server side code as well).
So the next step from that would be to automatically place down the box, take the item, and then break the box. But that brings many issues with trying to decide where to place the box so that it doesn't update any redstone stuff or interfere with something else, and should the box be broken automatically at all, and how to make sure that the broken box item doesn't drop somewhere and get lost... basically I don't want to deal with all those issues. Plus personally I don't even want the base Litematica mod to offer that much automation/shortcuts for survival play. Personally I don't even really like Easy Place mode, it already feels a step too far for me.
There are two options to make it easier to find and grab the box that has the item from your inventory though. One option is just for highlighting the item or the shulker box that has the item for the schematic block you are currently looking at (Generic -> highlightBlockInInventory
), and the other is for "pick blocking the shulker" i.e. moving the box to your hand so you can place it yourself to take out the required item (Generic -> pickBlockShulkers
).
So @tr7zw are you working on an addon that do what I searching for?
Since I just noticed that issue while looking for something else, https://github.com/tr7zw/ItemSwapper does implement this exact behavior. Currently looking into fixing some pick block logic I apparently overwrite on litematicas end.