ItemEvents.entityInteracted("minecraft:glass_bottle", event => {
    let { level, target, player, item, server, hand } = event
    if (target.type == "minecraft:interaction") {
        level.playSound(null, target.x, target.y, target.z, "minecraft:item.bottle.fill_dragonbreath", "master", 1, 1)

        item.count--
        player.give('minecraft:dragon_breath')
        if (target.persistentData.BottlesCollected == undefined) target.persistentData.BottlesCollected = 0
        target.persistentData.BottlesCollected++
        if (target.persistentData.BottlesCollected >= 8) {
            target.remove("discarded")
        }
    }
})

//ItemEvents.entityInteracted("minecraft:glass_bottle", event => {
	//if (event.target.type == "minecraft:interaction") {
		//event.server.runCommandSilent(`execute in ${event.entity.level.dimension} positioned ${event.entity.x} ${event.entity.y} ${event.entity.z} run playsound minecraft:item.bottle.fill_dragonbreath master @a ~ ~ ~ 1 1`)
		//event.item.count--
		//event.player.give('minecraft:dragon_breath')
    //}
//})