Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not so much of an issue, more a request #11

Open
pesegolsson opened this issue Jul 14, 2019 · 3 comments
Open

not so much of an issue, more a request #11

pesegolsson opened this issue Jul 14, 2019 · 3 comments

Comments

@pesegolsson
Copy link

could you add code to the sorter so that it sorts out shulker boxes with item in them into its own category?

that would make things so much easier as they gets stoes in seperate chests.

@jhuckaby
Copy link
Owner

I'll look into this, but I'm afraid this is too complex a task for me. I have no idea how to look inside shulkers using datapack commands. We need to get Seth Bling to code this up for us 😉

@isaaclepes
Copy link

isaaclepes commented Oct 6, 2020

Would this help?

if Trapped Chest has Shulker Box that has items
/execute if block -126 62 -168 minecraft:trapped_chest{Items:[{id:"minecraft:shulker_box",tag:{BlockEntityTag:{Items:[{}]}}}]}

if trapped chest has Shulker Box that is empty
/execute if block -126 62 -168 minecraft:trapped_chest{Items:[{id:"minecraft:shulker_box",tag:{BlockEntityTag:{Items:[]}}}]}

if chest has Any item that contains an item
/execute if block -126 62 -168 minecraft:trapped_chest{Items:[{tag:{BlockEntityTag:{Items:[{}]}}}]}

You can get specific by adding in the Slot: , id;, etc into the last Items:[{}] part

@isaaclepes
Copy link

isaaclepes commented Oct 6, 2020

I had time to play with it in-game

This command will teleport only items on the ground that contain a shulkerbox that has some item in it
/tp @e[type=item,nbt={Item:{id:"minecraft:shulker_box",tag:{BlockEntityTag:{Items:[{}]}}}}] @s

Teleport item if it contains a box containing a chorus_fruit anywhere in it
/tp @e[type=item,nbt={Item:{id:"minecraft:shulker_box",tag:{BlockEntityTag:{Items:[{id:"minecraft:chorus_fruit"}]}}}}] @s

It doesn't seem to work the same for detecting empty shulker boxes inside an item entity as it does with chests. Might just need to play with the syntax
Not working:
/tp @e[type=item,nbt={Item:{id:"minecraft:shulker_box",tag:{BlockEntityTag:{Items:[]}}}}] @s

Otherwise just run the check for non-empty boxes first, then check for any remaining ones after that.

I remember seeing a bug on Mojang for problems with nested NBT data, but I can't find it now. It does appear resolved, at least partially, since I am able to work with nested NBT on 1.16.3 as shown above.

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

No branches or pull requests

3 participants