Closed ChainDev162 closed 1 month ago
For anyone wondering, the command which has the weird execute
message was execute as @a[nbt={SelectedItem:{id:"minecraft:sugar",tag:{display:{Name:"{\"text\":\"Crack\"}"}}}}] at @s run function crack:apply_effects
, also here's my file structure:
The Spyglass config file needs to be at the root of your workspace, meaning at the same level as your python file there. Also, the pack format for 1.20.6 is 41, as can be seen here.
Adding to what Ellivers said, even in 1.20.6 your command would not be valid anymore. The tag
field no longer exists. Instead you should probably use execute if items
.
As Misode pointed out, the tag
warning will still show in 1.20.6, since it was removed in 1.20.5. You need to use the components
tag or execute if items
command to select based on item data. For more information and help regarding that, I'd recommend joining the Minecraft Commands discord server.
As Misode pointed out, the
tag
warning will still show in 1.20.6, since it was removed in 1.20.5. You need to use thecomponents
tag orexecute if items
command to select based on item data. For more information and help regarding that, I'd recommend joining the Minecraft Commands discord server.
so this?
execute as @a if data entity @s {SelectedItem:{id:"minecraft:sugar",display:{Name:'{"text":"Crack"}'}}} run function crack:apply_effects
With execute if items
, the command would be execute as @a if items entity @s weapon.mainhand minecraft:sugar[minecraft:custom_name='{"text":"Crack"}'] run function crack:apply_effects
.
However, for most cases, I wouldn't recommend checking for the name of the item. It depends on your use case, but most of the time it's a better idea to give it a tag within the minecraft:custom_data
component and check for that instead, since text components can be unreliable. This isn't really a place for command help, so if you have more questions, please join the Discord server I linked.
Hello, I was making a modpack for my world which is on 1.20.6, and I tried to change the loaded Spyglass version to 1.20.6, it kept bugging me with this error message: When I tried to change it using
.spyglassrc.json
to 1.20.6, it said this when i hovered overexecute
: I reloaded it not once, not twice, but three times so far, and i tried usingspyglass.json
, nothing. Please help as I'm just trying to have fun as a beginner to minecraft technicality.