execute if score @s Level matches ..9 run tag @s add xpstorefail
execute if entity @s[tag=xpstorefail] run function survivalplus:tools/pot/xpstore/fail
execute if score @s Level matches 10..19 run function survivalplus:tools/pot/xpstore/10
execute if score @s Level matches 20..29 run function survivalplus:tools/pot/xpstore/20
execute if score @s Level matches 30.. run function survivalplus:tools/pot/xpstore/30

execute if entity @s[tag=!xpstorefail] run function survivalplus:tools/pot/xpstore/effect
tag @s remove storexp
advancement revoke @s only survivalplus:tools/pot/xpstore