execute store result score @s apothecary_potion_pick run random value 1..6

execute if score @s apothecary_potion_pick matches 1 run give @s splash_potion[potion_contents={custom_effects:[{id:"minecraft:health_boost",amplifier:0,duration:400}]},custom_name='[{"bold":true,"color":"blue","italic":false,"text":"[RARE] "},{"bold":false,"color":"white","italic":false,"text":"Health Boost Potion"}]'] 1
execute if score @s apothecary_potion_pick matches 2 run give @s splash_potion[potion_contents={custom_effects:[{id:"minecraft:resistance",amplifier:0,duration:400}]},custom_name='[{"bold":true,"color":"blue","italic":false,"text":"[RARE] "},{"bold":false,"color":"white","italic":false,"text":"Bulwark Potion"}]'] 1
execute if score @s apothecary_potion_pick matches 3 run give @s splash_potion[potion_contents={custom_effects:[{id:"minecraft:wither",amplifier:1,duration:400}]},custom_name='[{"bold":true,"color":"blue","italic":false,"text":"[RARE] "},{"bold":false,"color":"white","italic":false,"text":"Withering Potion"}]'] 1
execute if score @s apothecary_potion_pick matches 4 run give @s splash_potion[potion_contents={custom_effects:[{id:"minecraft:slowness",amplifier:2,duration:200}]},custom_name='[{"bold":true,"color":"blue","italic":false,"text":"[RARE] "},{"bold":false,"color":"white","italic":false,"text":"Binding Potion"}]'] 1
execute if score @s apothecary_potion_pick matches 5 run give @s splash_potion[potion_contents={custom_effects:[{id:"minecraft:poison",amplifier:2,duration:600}]},custom_name='[{"bold":true,"color":"blue","italic":false,"text":"[RARE] "},{"bold":false,"color":"white","italic":false,"text":"Toxin Potion"}]'] 1
execute if score @s apothecary_potion_pick matches 6 run give @s splash_potion[potion_contents={custom_effects:[{id:"minecraft:levitation",amplifier:2,duration:200}]},custom_name='[{"bold":true,"color":"blue","italic":false,"text":"[RARE] "},{"bold":false,"color":"white","italic":false,"text":"Levitation Potion"}]'] 1

title @s actionbar [{"text": "xx ","obfuscated": true,"color": "#249ad0","bold": true},{"bold":true,"color":"blue","obfuscated": false,"italic":false,"text":"[RARE]"},{"text": " xx","obfuscated": true,"color": "#249ad0","bold": true}]
playsound minecraft:block.note_block.chime player @a[distance=..8] ~ ~1 ~ 10 1.2
playsound minecraft:entity.player.levelup player @a[distance=..8] ~ ~1 ~ 10 1
particle totem_of_undying ~ ~1 ~ 0 0 0 0.5 20

tag @s remove apothecary_rolling