playsound custom.shard.break.layer1 ambient @a ~ ~ ~
playsound custom.shard.break.layer2 ambient @a ~ ~ ~

clear @s amethyst_shard{name:"small_flow_shard"}
clear @s amethyst_shard{name:"small_soul_shard"}
clear @s amethyst_shard{name:"spinning_shard"}
clear @s amethyst_shard{name:"small_strength_shard"}
clear @s amethyst_shard{name:"small_attack_speed_shard"}
clear @s amethyst_shard{name:"small_mana_cost_shard"}
clear @s amethyst_shard{name:"small_speed_shard"}
clear @s amethyst_shard{name:"small_health_shard"}
clear @s amethyst_shard{name:"small_protection_shard"}
clear @s amethyst_shard{name:"small_mana_shard"}
clear @s amethyst_shard{name:"small_luck_shard"}
clear @s amethyst_shard{name:"small_pure_shard"}

execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_flow_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_flow_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_soul_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_soul_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_strength_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_strength_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_attack_speed_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_attack_speed_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_mana_cost_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_mana_cost_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_speed_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_speed_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_health_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_health_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_protection_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_protection_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_mana_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_mana_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_luck_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_luck_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"medium_pure_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/medium_pure_shard

execute store result score n_items items_generic run clear @s amethyst_shard{name:"big_strength_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/big_strength_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"big_attack_speed_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/big_attack_speed_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"big_mana_cost_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/big_mana_cost_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"big_speed_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/big_speed_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"big_health_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/big_health_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"big_protection_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/big_protection_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"big_mana_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/big_mana_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"big_luck_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/big_luck_shard
execute store result score n_items items_generic run clear @s amethyst_shard{name:"big_pure_shard"}
execute unless score n_items items_generic matches 0 run function items_py:shard_break/all/big_pure_shard

execute positioned ~ ~1.7 ~ run tag @e[type=item,nbt={Item:{tag:{type:"shard"}}},distance=..0.4] add no_timeout