xp add @s -551
tag @s add storexp
execute if entity @s[nbt={SelectedItem:{id:"minecraft:glass_bottle",count:1}}] run tag @s add bottlemain
execute if entity @s[nbt={Inventory:[{Slot:-106b,id:"minecraft:glass_bottle",count:1}]},tag=!bottlemain] run item replace entity @s weapon.offhand with potion[custom_data={20xppot:tag},potion_contents={custom_color:9895830},custom_name={"text":"Medium XP Bottle","italic":false,"color":"yellow"},lore=[{"text":"Holds 20 Levels worth","italic":false,"color":"gray"}],tooltip_display={hidden_components:[potion_contents]}]
item replace entity @s[tag=bottlemain] weapon.mainhand with potion[custom_data={20xppot:tag},potion_contents={custom_color:9895830},custom_name={"text":"Medium XP Bottle","italic":false,"color":"yellow"},lore=[{"text":"Holds 20 Levels worth","italic":false,"color":"gray"}],tooltip_display={hidden_components:[potion_contents]}]
tag @s remove bottlemain