scoreboard players set min times_appeared 0

execute if score #turbo_boots shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = turbo_boots times_appeared
execute if score #turbo_boots shop matches 1 if score turbo_boots times_appeared < min times_appeared run scoreboard players operation min times_appeared = turbo_boots times_appeared

execute if score #sloth_curse shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = sloth_curse times_appeared
execute if score #sloth_curse shop matches 1 if score sloth_curse times_appeared < min times_appeared run scoreboard players operation min times_appeared = sloth_curse times_appeared

execute if score #horse_shoe shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = horse_shoe times_appeared
execute if score #horse_shoe shop matches 1 if score horse_shoe times_appeared < min times_appeared run scoreboard players operation min times_appeared = horse_shoe times_appeared

execute if score #mana_bottle shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = mana_bottle times_appeared
execute if score #mana_bottle shop matches 1 if score mana_bottle times_appeared < min times_appeared run scoreboard players operation min times_appeared = mana_bottle times_appeared

execute if score #lunch_box shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = lunch_box times_appeared
execute if score #lunch_box shop matches 1 if score lunch_box times_appeared < min times_appeared run scoreboard players operation min times_appeared = lunch_box times_appeared

execute if score #the_art_of_the_sword shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = the_art_of_the_sword times_appeared
execute if score #the_art_of_the_sword shop matches 1 if score the_art_of_the_sword times_appeared < min times_appeared run scoreboard players operation min times_appeared = the_art_of_the_sword times_appeared

execute if score #shadow_clone shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = shadow_clone times_appeared
execute if score #shadow_clone shop matches 1 if score shadow_clone times_appeared < min times_appeared run scoreboard players operation min times_appeared = shadow_clone times_appeared

execute if score #spinning_stone shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = spinning_stone times_appeared
execute if score #spinning_stone shop matches 1 if score spinning_stone times_appeared < min times_appeared run scoreboard players operation min times_appeared = spinning_stone times_appeared

execute if score #endless_food_crate shop matches 1 if score min times_appeared matches -1 run scoreboard players operation min times_appeared = endless_food_crate times_appeared
execute if score #endless_food_crate shop matches 1 if score endless_food_crate times_appeared < min times_appeared run scoreboard players operation min times_appeared = endless_food_crate times_appeared
execute if score min times_appeared matches -1 run scoreboard players set min times_appeared 0