drinkable-xp/pack/data/drinkable_xp/function/bottle/thrown.mcfunction
2024-08-31 21:19:54 +01:00

11 lines
434 B
Mcfunction

# stop the experience bottle from being thrown
execute as @e[type=experience_bottle] run kill @s
stopsound @s * entity.experience_bottle.throw
# add xp and give a bottle
xp add @s 7 points
execute at @s run playsound minecraft:entity.experience_orb.pickup player @p ~ ~ ~ 0.25
execute if score @s giveEmptyBottle matches 0 run give @s minecraft:glass_bottle
# reset the xpBottleThrow score
scoreboard players set @s xpBottleThrow 0