import { ItemStack } from '@minecraft/server';

export function onUseOn(event) {
    const { usedOnBlockPermutation, source } = event;
    
    // Replace the bucket with an empty one
    const equippable = source.getComponent("equippable");
    const emptyBucket = new ItemStack('lv_mo:empty_infinite_water_bucket', 1);
    equippable.setEquipment('Mainhand', emptyBucket);
}

const infinite_water_bucket = {
    onUseOn: onUseOn,
};
export default infinite_water_bucket;
