Command in Datapack is not working?

Ar
- in Worlds
5

Hi. I wanted to create a datapack in which there's a scoreboard that counts how many XPCoins (64XP Points = 1XPCoin, 128XP Points = 2XPCoins, etc.) exist in one world. I already have these two commands:

execute at @a if score WorldXp XPCoins matches 0.0 if score @s XP matches 64.127 run scoreboard players set WorldXp XPCoins 1
execute at @a if score WorldXp XPCoins matches 1.1 if score @s XP matches 128.255 run scoreboard players set WorldXp XPCoins 2

Ingame works when I enter it. If I let this run in the datapack with Minecraft.tick it does not work.

Can who help me?

Cr

This is because the / execute command can only be applied to a single target.

Ar

How do you mean that? Can I just do an if or something?

Ar

And is there another solution?

Be

If you use @s in execute, you either have to use as @s at @s or if you do not play position role as @s

execute as @a at @s if score WorldXp XPCoins matches 0.0 if score @s XP matches 64.127 run scoreboard players set WorldXp XPCoins 1

execute as @a if score WorldXp XPCoins matches 0.0 if score @s XP matches 64.127 run scoreboard players set WorldXp XPCoins 1

Cr

No. There can be only one target, which you can select via @a, @r, @s or @p. You can e.g. @a [limit = 1], but the command can't be applied correctly because it only takes one target