If storage data has too many tags, the whole root tag can't be cleared by one command.
/data modify storage minecraft:test {} set value {}
/data merge storage minecraft:test {}
Recently, the only way to empty storage data is to remove the child tags one by one. I hope there's a method or sub-command to remove storage data.
Comments 6
This still affects latest version (1.20.2) and I'd argue it is a bug and not a feature request. As the Minecraft Wiki points out, an NBT path of "{}" should select the root tag.
This works when getting data. The following command will give the entirety of the "example:test" storage compound.
/data get storage example:test {}
But it doesn't work when deleting data. This command gives the error message "Nothing changed. The specified properties already have these values".
/data remove storage example:test {}
Deleting or setting root to a non-compound value has never been accepted, anywhere, not storage, not entity data, nowhere.
As it stands, it is not a bug and actually consistent.
I agree that this is a bug and should be fixed. For those encountering the same issue in this report, I suggest that every storage you create has all data points under a single tag e.g:
{root_tag: {foo:1b, bar:0b, data: [3,1,4 ,1,5,9]} }
that way the storage can be deleted using /data remove ~ root_tag
If this is not possible through the root tag selector, what is the intended command to clear a given storage, especially if it has a large number of first-level tags?
This is a feature request