I'm currently working on a data pack the reworks the leveling system in Minecraft. One of the things that I'm currently struggling with is putting the XP orb into a scoreboard instead of your XP bar. I have tried multiple different variations of commands but it is not working for some reason.
What I have currently have tried is:
execute as @a at @s unless score @s p_lvl = @s pm_lvl if entity @e[type=experience_orb,nbt={Value:1s},distance=..1.5] run scoreboard players add @s reserve 1
Breaking down the command:
- If A and B are not equal & experience orb is 0-1.5 blocks away
- then add 1 to C