SpyglassMC / Spyglass

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

The "loot_table" type of Loot table has key "name" instead of "value" in new versions #1514

Open Dahesor opened 2 months ago

Dahesor commented 2 months ago

The "loot_table" type of loot table allows player to reference another loot table. In 1.21, it uses the key "value" instead of "name".

Currently spyglass only accepts "name" for all versions.

image

image

Thanks

NeunEinser commented 2 months ago

Looks like Spyglass is detecting the wrong version.

What is your pack_format in pack.mcmeta at?

Dahesor commented 2 months ago

Looks like Spyglass is detecting the wrong version.

What is your pack_format in pack.mcmeta at?

It is 48 I am pretty sure because I am using all the new things at the same time. All other validations are those for 1.21

Dahesor commented 2 months ago

Update:

I tried creating a new data pack with pack format 48, and this time it is correctly validated as "value".

However when I return to the original data pack, it still has this issue that it wants me to use "name" instead of "value".

Both data packs have the same pack format 48, and for your information, the one that has this issue was in pack format of 1.20.4 and I decided to upgraded it to 48.

misode commented 2 months ago

Can you try running the Spyglass: Reset Project Cache command?

Dahesor commented 2 months ago

Can you try running the Spyglass: Reset Project Cache command?

This worked. By some testing I found out that you can reproduce this by creating a data pack in lower versions, create a loot table with "type":"loot_table", then change the version back to 48. After renaming the folder "loot_tables" to "loot_table", this error happens.

So there is some cache that should be reset when the pack format is changed?

tryashtar commented 1 month ago

Yes #1212