command doesnt work in datapack but does in chat?
ok so im coding a datapack with custom advancements etc. etc. and I have a feature where I want to play an effect if a player dies.
the file tree looks like this (starting from the root; its all folders): Datapack -> data -> skyquest -> function -> system -> effects
in that effects folder there are 2 files: -> death (folder) -> init.mcfunction
the init.mcfunction consists of the following:
execute as @a[scores={effects.player_has_died=1..}] if score effects effects.death.cooldown matches 0 run function skyquest:system/effects/death/play_effect-# I know that im checking for a player called "effects". that player doesnt exist and I manually set its 'effects.death.cooldown' score to 0
in the "death" folder there are two more files called play_effect.mcfunction:
execute as @a run playsound minecraft:entity.lightning_bolt.thunder schedule function skyquest:system/effects/death/cooldown 1sand cooldown.mcfunction:
scoreboard players reset @a effects.player_has_died scoreboard players set effects effects.death.cooldown 0now my problem is that all of this doesnt work except the playsound command in the play_effect.mcfunction. the cooldown function is stuck in the schedule and never gets executed, the effects.player_has_died score never gets reset and the init.mcfunction never gets executed by the tick.json (even though it is correctly listed there). when I execute that command from the init.mcfunction in chat, everything works except that schedule command which is crucial.