tag @a add musiceffect
scoreboard objectives add musicdespawn dummy musicdespawn
scoreboard objectives add ocarinacooldown dummy ocarinacooldown
scoreboard objectives add harpcooldown dummy harpcooldown
scoreboard objectives add drumcooldown dummy drumcooldown

execute @e[tag=ocarinaeffect] ~ ~ ~ tp @s ~ ~ ~
execute @e[tag=ocarinaeffect] ~ ~ ~ scoreboard players add @s ocarinacooldown 1
execute @e[tag=ocarinaeffect,scores={ocarinacooldown=40..}] ~ ~ ~ tag @s remove ocarinaeffect
execute @e[tag=!ocarinaeffect,scores={ocarinacooldown=40..}] ~ ~ ~ scoreboard players set @s ocarinacooldown 0

execute @a[tag=drumeffect] ~ ~ ~ scoreboard players add @s strengtheffect 1
execute @a[tag=drumeffect] ~ ~ ~ scoreboard players add @s speedeffect 1
execute @a[tag=drumeffect] ~ ~ ~ scoreboard players add @s drumcooldown 1
execute @a[tag=drumeffect,scores={drumcooldown=400..}] ~ ~ ~ tag @s remove drumeffect
execute @a[tag=!drumeffect,scores={drumcooldown=400..}] ~ ~ ~ scoreboard players set @s drumcooldown 0

execute @a[tag=harpeffect] ~ ~ ~ scoreboard players add @s regeneffect 3
execute @a[tag=harpeffect] ~ ~ ~ scoreboard players add @s harpcooldown 1
execute @a[tag=harpeffect,scores={harpcooldown=400..}] ~ ~ ~ tag @s remove harpeffect
execute @a[tag=!harpeffect,scores={harpcooldown=400..}] ~ ~ ~ scoreboard players set @s harpcooldown 0

execute @e[type=vatonage:bell_projectile] ~ ~ ~ tag @s add musicprojectile
execute @e[type=vatonage:clarinet_projectile] ~ ~ ~ tag @s add musicprojectile
execute @e[type=vatonage:electric_guitar_projectile] ~ ~ ~ tag @s add musicprojectile
execute @e[type=vatonage:flute_projectile] ~ ~ ~ tag @s add musicprojectile
execute @e[type=vatonage:guitar_projectile] ~ ~ ~ tag @s add musicprojectile
execute @e[type=vatonage:kazoo_projectile] ~ ~ ~ tag @s add musicprojectile
execute @e[type=vatonage:triangle_projectile] ~ ~ ~ tag @s add musicprojectile
execute @e[type=vatonage:trumpet_projectile] ~ ~ ~ tag @s add musicprojectile
execute @e[type=vatonage:violin_projectile] ~ ~ ~ tag @s add musicprojectile

execute @e[tag=musicprojectile] ~ ~ ~ particle minecraft:note_particle ~ ~ ~
scoreboard players add @e[tag=musicprojectile] musicdespawn 1
execute @e[tag=musicprojectile,scores={musicdespawn=40..}] ~ ~ ~ kill @s