import * as utils from "../utils.js";

export async function onItemCompleteUse(event) {
    const player = event.source;
    const item = event.itemStack;
    if (item && item.typeId === "pu_sg:aloe_vera_flower") {
        utils.runPlayerCommand(player, "effect @s instant_health 1 0 true");
        const dimension = player.dimension;
        const location = player.location;
        dimension.playSound("pu_sg:aloe_vera_heal", location);
        dimension.spawnParticle("pu_sg:healing_bag_1", location);
        dimension.spawnParticle("pu_sg:healing_bag_2", location);
        dimension.spawnParticle("pu_sg:healing_bag_3", location);
        dimension.spawnParticle("pu_sg:healing_bag_4", location);
    }
}