// Remove recipes
ServerEvents.recipes(event => {
    event.remove({ output: 'explorerscompass:explorerscompass' });
    event.remove({ output: 'eeeabsmobs:demolisher' });
    event.remove({ output: 'fantasy_armor:moon_crystal' });
    event.remove({ output: 'twilightforest:glass_sword' });
    event.remove({ output: 'cataclysm:laser_gatling' });
    event.remove({ output: 'cataclysm:wither_assault_shoulder_weapon' });
    event.remove({ output: 'irons_spellbooks:netherite_spell_book' });
    event.remove({ output: 'irons_spellbooks:dragonskin_spell_book' });
    event.remove({ id: "twilightforest:uncrafting_table" })
    event.remove({ id: "aquamirae:terrible_sword" })
    event.remove({ id: "irons_spellbooks:eldritch_manuscript" });
});
ServerEvents.genericLootTables(event => {
    // Add coinsje items to simple dungeon loot table
    event.modify('minecraft:chests/simple_dungeon', table => {
        table.addPool(pool => {
            pool.rolls = [1, 2]; // Number of rolls for loot
            // Common coins
            pool.addItem('coinsje:copper_coin', 10); // More common
            pool.addItem('coinsje:copper_coin_pile', 8);
            pool.addItem('coinsje:iron_coin', 6);
            pool.addItem('coinsje:iron_coin_pile', 5);

            // Rare coins
            pool.addItem('coinsje:gold_coin', 4); // Rarer
            pool.addItem('coinsje:gold_coin_pile', 4);
            pool.addItem('coinsje:diamond_coin', 4); // Rarest
            pool.addItem('coinsje:diamond_coin_pile', 4);
        });
    });

    // Add coinsje items to ancient city loot table
    event.modify('minecraft:chests/ancient_city', table => {
        table.addPool(pool => {
            pool.rolls = [3, 4]; // Number of rolls for loot
            // Common coins
            pool.addItem('coinsje:copper_coin', 8); // More common
            pool.addItem('coinsje:copper_coin_pile', 6);
            pool.addItem('coinsje:iron_coin', 5);
            pool.addItem('coinsje:iron_coin_pile', 4);

            // Rare coins
            pool.addItem('coinsje:gold_coin', 5); // Rarer in the ancient city
            pool.addItem('coinsje:gold_coin_pile', 5);
            pool.addItem('coinsje:diamond_coin', 4); 
            pool.addItem('coinsje:diamond_coin_pile', 3);
        });
    });

    // Add coinsje items to village armorer loot table
    event.modify('minecraft:chests/village/village_armorer', table => {
        table.addPool(pool => {
            pool.rolls = [3, 4];
            pool.addItem('coinsje:copper_coin', 10);
            pool.addItem('coinsje:iron_coin', 5);
            pool.addItem('coinsje:gold_coin', 2);
        });
    });

    // Add coinsje items to village toolsmith loot table
    event.modify('minecraft:chests/village/village_toolsmith', table => {
        table.addPool(pool => {
            pool.rolls = [3, 4];
            pool.addItem('coinsje:copper_coin', 8);
            pool.addItem('coinsje:iron_coin', 6);
            pool.addItem('coinsje:gold_coin', 4);
        });
    });

    // Add coinsje items to village weaponsmith loot table
    event.modify('minecraft:chests/village/village_weaponsmith', table => {
        table.addPool(pool => {
            pool.rolls = [3, 4];
            pool.addItem('coinsje:copper_coin', 10);
            pool.addItem('coinsje:iron_coin', 6);
            pool.addItem('coinsje:gold_coin', 4);
        });
    });
});
ServerEvents.genericLootTables(event => {
    // Modify the loot table for the Dark Doppelganger
    event.modify('darkdoppelganger:entities/dark_doppelganger', table => {
        table.addPool(pool => {
            pool.rolls = [1]; // Define how many times the loot pool is rolled

            // Add the coinsje:netherite_coin_pile with a weight of 1 (rarer)
            pool.addItem('coinsje:netherite_coin_pile', 2);
            pool.addItem('coinsje:diamond_coin_pile', 3); // Rare drop
        });
    });
})
EntityEvents.drops(event => {
    if (event.entity.type == 'sons_of_sins:wistiver') {
        event.drops.clear();
    }
});
EntityEvents.drops(event => {
    if (event.entity.type == 'sons_of_sins:blud') {
        event.drops.clear();
    }
});
ServerEvents.recipes(event => {
    event.shaped('enigmaticlegacy:enigmatic_amulet', [
        ' E ',
        'BCS',
        ' E '
    ], {
        E: 'minecraft:emerald',
        S: 'enigmaticlegacy:magnet_ring',
        C: 'enigmaticlegacy:golem_heart',
        B: "minecraft:book"
    })
})
