SpyglassMC / Spyglass

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

"attributes" key in entity NBT being unknown #1580

Closed saladbowling closed 3 months ago

saladbowling commented 3 months ago

I don't know if this has been reported yet. However, I came across this while developing.

I'm unsure if this was changed in 1.20.5 or 1.21, but the "Attribute" key was replaced by "attribute" in entity summon commands.

e.g. (previously) /summon zombie ~ ~ ~ {Attributes:[{Name:"minecraft:generic.max_health",Base:500}],Health:500f}

e.g. latest version /summon zombie ~ ~ ~ {attributes:[{id:"minecraft:generic.max_health",base:500}],Health:500f}

When typing the latest version command into Spyglass, it warns that "attribute" is an unknown key. It seems that the attribute NBT tree has not been updated yet.

I also can confirm my pack.mcmeta file is 48 for 1.21.

Correct Usage: image

Incorrect Usage (from 1.20.4 and before and what Spyglass uses): image

Unknown key of "attribute" when you use it correctly: image

A great extension! An excellent tool for mapmaking.

Ellivers commented 3 months ago

I can't reproduce this.

MulverineX commented 3 months ago

probably a cache issue, @saladbowling run the vscode command Spyglass: Clear Project Cache

saladbowling commented 3 months ago

Hi @MulverineX, that fixed it. I appreciate your help!