particle minecraft:happy_villager ~ ~.3 ~ .1 .1 .1 0 5

execute store result score random itemcount run random value 1..4
execute if score random itemcount matches 1 run effect give @p luck 600
execute if score random itemcount matches 1 run function survivalplus:tools/xprewardbig
execute if score random itemcount matches 2 run effect give @p luck 600 1
execute if score random itemcount matches 2 run function survivalplus:tools/xprewardmed
execute if score random itemcount matches 3 run effect give @p luck 600 2
execute if score random itemcount matches 3 run function survivalplus:tools/xprewardminor
execute if score random itemcount matches 4 run effect give @p luck 600 3
execute if score random itemcount matches 4 run summon experience_orb ~ ~ ~ {Value:2,Motion:[0d,.2d,0d]}

playsound minecraft:entity.player.levelup player @a ~ ~ ~ .5 2
summon item ~ ~ ~ {Item:{id:emerald,count:1b}}
kill @s