0

The commands are applying to everyone in the server (every entity on the first one) and not just the person with the tag, these are the commands in the tick.mcfunction file:

execute as @e at @e if entity @s[tag=glasswalker] run setblock ~ ~-1 ~ glass 
execute as @a if entity @s[nbt={Inventory:[{id:"minecraft:diamond",tag:{display:{Name:'{"text":"these are my diamonds"}'}}}]}] run kill
execute as @a at @a if entity @s[tag=earthmage] run setblock ^ ^ ^10 dirt
execute as @a at @a if entity @s[tag=firemage] run setblock ~ ~ ~ fire 
execute as @a at @a if entity @s[tag=firemage] run effect give @s fire_resistance 5 
execute as @a at @a if entity @s[tag=watermage] run fill ~ ~ ~ ~ ~1 ~ water
execute as @a at @a if entity @s[tag=watermage] run effect give @s water_breathing 5 
execute as @a at @a if entity @s[tag=deletion] run clone ^ ^ ^10 ^ ^ ^ ^ ^ ^ replace move 

I have no idea how to fix this.

4
  • Have you tried using double quotes for tag name?
    – pinckerman
    Oct 23, 2021 at 17:44
  • No I have not tried that.
    – Mail-Main
    Oct 23, 2021 at 17:50
  • The datapack extension I have on VScode says that it "expected a tag but got nothing"
    – Mail-Main
    Oct 23, 2021 at 17:53
  • @pinckerman That is only a thing on MCBE Oct 23, 2021 at 18:17

1 Answer 1

2

You are overcomplicating your commands so much that this is causing them to fail.

Your overcomplicated version: Simpler and works:
execute
as @e
at @e
if entity @s[tag=glasswalker]
run …
execute
as @e[tag=glasswalker]
at @s
run …
execute
as @a
at @a
if entity @s[tag=earthmage]
run …
execute
as @a[tag=earthmage]
at @s
run …

… and so on.

As for the second command, which doesn't match the style of the commands I showed in the table, there is a different problem—you are testing for custom item names. This is bad practice and should be avoided. See my other question for why and how to fix it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .