2
So, in my data pack i wanted to add a way for it to detect the players active effects. The detection function won't work if I let it run through the data pack as a scheduled function but however it DOES work when ran in a world on a repeating command block. If anyone could help me out I'd apprechiate it a thousand times.
here's the code:
schedule function player_scan:jump_boost 10t replace
execute if entity @a[nbt={ActiveEffects:[{Id:8, Amplifier: 1b}]}] run tellraw @a " Effect detected"
here's the code:
schedule function player_scan:jump_boost 10t replace
execute if entity @a[nbt={ActiveEffects:[{Id:8, Amplifier: 1b}]}] run tellraw @a " Effect detected"
3
(solve):
calling the active effect from @a was the problem, since it's calling from too many entities, idk how I didn't notice that.
execute if entity @r[nbt={ActiveEffects:[{Id:8, Amplifier: 1b}]}] run tellraw @a "Effect detected" works totally fine...
calling the active effect from @a was the problem, since it's calling from too many entities, idk how I didn't notice that.
execute if entity @r[nbt={ActiveEffects:[{Id:8, Amplifier: 1b}]}] run tellraw @a "Effect detected" works totally fine...
Try replacing the 8 under ID with '8b'. It seems to work.
replacing the id 8 with 8b doesn't work for me, it just tells me it expects an int tag not a byte tag. That's why I'm so confused, but thank you for your input.
