SpyglassMC / Spyglass

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

False "expected nothing" error when using NBT. #1502

Closed dragon3025 closed 1 month ago

dragon3025 commented 1 month ago

When I use NBT as a target selector I get an "Expected nothing" error: Screenshot (106)

I tested it out execute as @e[type=!#minecraft:immune_to_oozing, nbt={active_effects:[{id:"minecraft:oozing"}]}] run say test and it was working fine. I also tested out execute if entity @e[type=pig, nbt={PersistenceRequired:1b}] run say persistent and it was also working fine, but it visual studio code was showing the same error, so I think it's happening if you use anything for nbt.

EDIT: The yellow error for schedule function server:second 1s, is saying that it cannot find the function, which is also false because the function is continuously running every second.

EDIT: Okay, I just realized it's doing when using Nbt for anything (for example: summoning a mob). Even if it's just brackets with nothing in it.

misode commented 1 month ago

@dragon3025 Hey, I cannot reproduce the issues you're having. Could you provide the output log of the spyglass language server? You can get that by pressing Ctrl+Shift+U and then selecting Spyglass Language Server in the dropdown

dragon3025 commented 1 month ago

@dragon3025 Hey, I cannot reproduce the issues you're having. Could you provide the output log of the spyglass language server? You can get that by pressing Ctrl+Shift+U and then selecting Spyglass Language Server in the dropdown

Here's the log: https://pastebin.com/3vaCmenp

misode commented 1 month ago

I see the warnings Tried to access unknown dispatcher minecraft:entity which are not normal. Can you try running the Spyglass: Reset Project Cache command? If that doesn't work, run the Spyglass: Open Cache Folder command, close vscode, delete everything in that cache folder, and reopen vscode again.

dragon3025 commented 1 month ago

I tried both, but it's still happening. This is the log I got after deleting everything in the cache folder and re-opening vscode: https://pastebin.com/u7tRJvGi

NeunEinser commented 1 month ago

Is your datapack publicly available, or would you be able to share it for us to see if we can reproduce it with your pack?

dragon3025 commented 1 month ago

Is your datapack publicly available, or would you be able to share it for us to see if we can reproduce it with your pack?

I have an example pack here: https://modrinth.com/datapack/end-gateway-placer. When I load the folder in visual studio, I get this error: Screenshot (108) Here's the log for it: https://pastebin.com/swGCHUv0

MulverineX commented 1 month ago

Are you on discord? Would you be up for a voice call? It would be useful to be able to debug this live with you.

misode commented 1 month ago

@dragon3025 Could you share your users settings? Or disable all your user settings? If that doesn't fix it, try also disabling all other extensions.

dragon3025 commented 1 month ago

I figured it out. I have this .gitignore file:

Server/
zzz*/
*(Edited)/

For some reason the Server/ line in it was causing this. I fixed it by changing the line to Server_Pack/, renaming my Server datapack the same way, then opening visual studio code. I'll attach a copy of my datapack folder. datapacks.zip