TransWikia.com

How do you delete items in "invisible" slots of shulkers with commands?

Arqade Asked on October 4, 2021

When you generate a shulker with stacked items that are supposed to be unstackable inside, then break it, the items separate, and while 27 of them remain visible, the other 37 items (provided that you generated a shulker with a single stack of tools) go into "invisible slots", where the player cannot access them, but still remain observable through NBT tags. If you have a lot more items in a shulker, having these broken "invisible slot" shulkers can put significant strain on a server, because the game renders all of these tools and their respective tags seperately.

Example of stacked shulker (use /give @p minecraft:purple_shulker_box{BlockEntityTag:{Items:[{id:"minecraft:diamond_pickaxe",Count:64b}]}})

shulker with illegally stacked tools

After you break one of these shulkers in survival, they seperate like so:

Previously shown shulker, unstacked

While it may appear that there are only 27 normal diamond pickaxes inside the shulker, when running the command /data get entity @p directly after breaking it (placing it seems to normalize all the invisible slots) shows this (I wasn’t able to fit all of the output into the screencap):

enter image description here

With all this said, I’m trying to create a datapack that will modify these illegal shulkers so that the invisble items inside the shulker are destroyed, so that it won’t lag the server out so much, but I’m not sure how I can do this. Any ideas?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP