SpyglassMC / Spyglass

Development tools for vanilla Minecraft: Java Edition data pack developers.
https://spyglassmc.com
MIT License
303 stars 31 forks source link

Redundant NBT list check warning #1449

Open tryashtar opened 3 months ago

tryashtar commented 3 months ago

Commands like this one are redundant, since NBT list matches ignore index and quantity:

kill @a[nbt={Motion:[0d,0d,0d]}]

Spyglass could detect this and show a warning.

As misode aptly pointed out in #1317, it's more than just duplicates that are redundant; any superset compounds should warn as well:

execute if data entity @s {HandItems:[{},{id:"minecraft:apple"}]}
NeunEinser commented 3 months ago

Adding a warning for superset compounds is blocked by #1228