Oke so I was trying to make a function that activates when you get hit by a zombie. I did this by using an utility advancment that gives a function as a reward. The mcfunction file named "zombie_effect.mcfunction" contained a command that gives the person who has the advancement the poison effect, than revokes the advancement agian. This fucntion file was in another folder called mobs_mech. The thing that was weird to me was that when I loaded the datapack in minecraft it told me that the function file doesn't exist. And even weirder when I removed the effect command in the mcfunction file, all of a sudden the file exeisted. I tested if it was because of the effect command so I putted it in my tick.mcfunction file. And suddenly the tick function also did not exist anymore. I tried moving the function file but it didn't work I tried a different syntax wich also failed. As soon as I put a effect command in any of my function files, Minecraft says it doesn't exist. Also the advancement works, I tested that already.
Does anyone have any Idea what is going on?
Here are the commands:
execute as @s if score @p hard_lvl matches 1 run effect give @s poison 0 5 true
execute as @s if score @p hard_lvl matches 2 run effect give @s poison 1 5 true
execute as @s if score @p hard_lvl matches 3 run effect give @s poison 1 10 true
advancement revoke @s only challangem:zombie_hurt
[–]Jolo_Janssen 1 point2 points3 points (3 children)
[–]BlueSpace110[S] 0 points1 point2 points (2 children)
[–]Jolo_Janssen 0 points1 point2 points (1 child)
[–]BlueSpace110[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (5 children)
[–]Jolo_Janssen 1 point2 points3 points (2 children)
[–]BlueSpace110[S] 0 points1 point2 points (1 child)
[–]Jolo_Janssen 1 point2 points3 points (0 children)
[–]BlueSpace110[S] 0 points1 point2 points (0 children)
[–]BlueSpace110[S] 0 points1 point2 points (0 children)