execute @s[tag=!on] ~ ~ ~ execute @p[r=3,scores={primarymagic=6,primarylevel=1..}] ~ ~ ~ scoreboard players add @s primaryexp 290
execute @s[tag=!on] ~ ~ ~ execute @p[r=3,scores={secondarymagic=6,secondarylevel=1..}] ~ ~ ~ scoreboard players add @s secondaryexp 290

execute @p[r=3,scores={primarymagic=6,primarylevel=1..}] ~ ~ ~ tag @e[type=vatonage:grassball2,r=3] add on
execute @p[r=3,scores={secondarymagic=6,secondarylevel=1..}] ~ ~ ~ tag @e[type=vatonage:grassball2,r=3] add on
execute @s[tag=!on] ~ ~ ~ tellraw @p {"rawtext":[{"text":"§cYou haven't unlocked this magic"}]}
execute @s[tag=!on] ~ ~ ~ replaceitem entity @p slot.weapon.mainhand 0 vatonage:empty_wand2
kill @s[tag=!on]

execute @s[scores={removedebris=1}] ~ ~ ~ playsound step.grass @a ~ ~ ~
particle minecraft:villager_happy ~ ~-0.1 ~

scoreboard objectives add removedebris dummy removedebris
scoreboard players add @s removedebris 1
execute @s[scores={removedebris=500..}] ~ ~ ~ kill @s

execute @s[scores={removedebris=1}] ~ ~ ~ effect @p[r=5] regeneration 2 0 true
execute @s[scores={removedebris=1..}] ~ ~ ~ execute @p[r=3,tag=magicpvp] ~ ~ ~ effect @a[r=5] regeneration 4 1 true
execute @s[scores={removedebris=10..}] ~ ~ ~ effect @e[r=4,tag=!magicpvp] poison 4 0

execute @s[scores={removedebris=10..}] ~ ~ ~ fill ~-2 ~-2 ~-2 ~2 ~2 ~2 grass 0 replace dirt