ItemEvents.rightClicked('kubejs:pouch', event => {
    let player = event.player;
    let level = event.level;
    let itemstack = event.item;

    // Array of possible items for random drop
    let randomDrops = [
        'armageddon_mod:withered_bone_effigy',
        'armageddon_mod:anhk_aegis',
        'armageddon_mod:thorned_requital',
        'armageddon_mod:life_necklace',
        'armageddon_mod:anathema_gauntlet',
        'armageddon_mod:vagabonds_hood',
        'armageddon_mod:ankh_tablet'
    ];

    // Array of guaranteed drops with quantities
    let guaranteedDrops = [
        { id: 'powder_power:blend_trilium', count: 4 },
        { id: 'powder_power:blend_redium', count: 4 },
        { id: 'powder_power:blend_lapium', count: 4 },
        { id: 'powder_power:blend_gemium', count: 4 },
        { id: 'create:experience_nugget', count: 32 }
    ];

    // Spawn one random item
    let randomIndex = Math.floor(Math.random() * randomDrops.length);
    let selectedItem = randomDrops[randomIndex];
    let randomItemEntity = level.createEntity("minecraft:item");
    randomItemEntity.setItem(Item.of(selectedItem, 1));
    randomItemEntity.setPos(player.x, player.y + 1, player.z);
    randomItemEntity.spawn();

    // Spawn guaranteed drops from the list
    guaranteedDrops.forEach(drop => {
        let itemEntity = level.createEntity("minecraft:item");
        itemEntity.setItem(Item.of(drop.id, drop.count));
        itemEntity.setPos(player.x, player.y + 1, player.z);
        itemEntity.spawn();
    });

    // Reduce the item stack by 1 (consume on use)
    itemstack.shrink(1);
});

ItemEvents.rightClicked('kubejs:better_pouch', event => {
    let player = event.player;
    let level = event.level;
    let itemstack = event.item;

    // Array of possible items for random drop
    let randomDrops = [
        'artifacts:flame_pendant',
        'artifacts:shock_pendant',
        'artifacts:obsidian_skull',
        'artifacts:antidote_vessel',
        'artifacts:bunny_hoppers',
        'artifacts:cross_necklace',
        'artifacts:panic_necklace',
        'artifacts:night_vision_goggles',
        'artifacts:pickaxe_heater',
        'artifacts:thorn_pendant',
        'artifacts:golden_hook',
        'artifacts:aqua_dashers',
        'artifacts:digging_claws',
        'relics:leather_belt',
        'relics:reflection_necklace',
        'relics:holy_locket',
        'relics:enders_hand',
        'relics:rage_glove',
        'relics:roller_skates',
        'relics:drowned_belt',
        'relics:magma_walker',
        'relics:midnight_robe'
        
    ];

    // Array of guaranteed drops with quantities
    let guaranteedDrops = [
        { id: 'powder_power:blend_trilium', count: 4 },
        { id: 'powder_power:blend_quadrilium', count: 2 },
        { id: 'create:experience_nugget', count: 32 }
    ];

    // Spawn one random item
    let randomIndex = Math.floor(Math.random() * randomDrops.length);
    let selectedItem = randomDrops[randomIndex];
    let randomItemEntity = level.createEntity("minecraft:item");
    randomItemEntity.setItem(Item.of(selectedItem, 1));
    randomItemEntity.setPos(player.x, player.y + 1, player.z);
    randomItemEntity.spawn();

    // Spawn guaranteed drops from the list
    guaranteedDrops.forEach(drop => {
        let itemEntity = level.createEntity("minecraft:item");
        itemEntity.setItem(Item.of(drop.id, drop.count));
        itemEntity.setPos(player.x, player.y + 1, player.z);
        itemEntity.spawn();
    });

    // Reduce the item stack by 1 (consume on use)
    itemstack.shrink(1);
});

ItemEvents.rightClicked('kubejs:great_pouch', event => {
    let player = event.player;
    let level = event.level;
    let itemstack = event.item;

    // Array of possible items for random drop
    let randomDrops = [
        'artifacts:chorus_totem',
        'artifacts:superstitous_hat',
        'artifacts:power_glove',
        'artifacts:feral_claws',
        'artifacts:vampiric_gloves',
        'artifacts:crystal_heart',
        'artifacts:everlasting_beef',
        'artifacts:lucky_scarf',
        'artifacts:running_shoes',
        'artifacts:steadfast_spikes',
        'artifacts:cloud_in_a_bottle',
        'relics:space_dissector',
        'relics:infinity_ham',
        'relics:elytra_booster',
        'relics:magic_mirror'
        
    ];

    // Array of guaranteed drops with quantities
    let guaranteedDrops = [
        { id: 'powder_power:blend_trilium', count: 2 },
        { id: 'powder_power:blend_quadrilium', count: 4 },
        { id: 'create:experience_nugget', count: 64 }
    ];

    // Spawn one random item
    let randomIndex = Math.floor(Math.random() * randomDrops.length);
    let selectedItem = randomDrops[randomIndex];
    let randomItemEntity = level.createEntity("minecraft:item");
    randomItemEntity.setItem(Item.of(selectedItem, 1));
    randomItemEntity.setPos(player.x, player.y + 1, player.z);
    randomItemEntity.spawn();

    // Spawn guaranteed drops from the list
    guaranteedDrops.forEach(drop => {
        let itemEntity = level.createEntity("minecraft:item");
        itemEntity.setItem(Item.of(drop.id, drop.count));
        itemEntity.setPos(player.x, player.y + 1, player.z);
        itemEntity.spawn();
    });

    // Reduce the item stack by 1 (consume on use)
    itemstack.shrink(1);
});