magic-sorting-system icon indicating copy to clipboard operation
magic-sorting-system copied to clipboard

not so much of an issue, more a request

Open pesegolsson opened this issue 5 years ago • 3 comments

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.

pesegolsson avatar Jul 14 '19 09:07 pesegolsson

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 😉

jhuckaby avatar Dec 15 '19 03:12 jhuckaby

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 avatar Oct 06 '20 00:10 isaaclepes

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.

isaaclepes avatar Oct 06 '20 16:10 isaaclepes