ServerEvents.recipes(event => {
    // Define the tiers and their primary material
    const horseTiers = [
        { id: 'minecraft:iron_horse_armor', mat: 'minecraft:iron_ingot' },
        { id: 'minecraft:golden_horse_armor', mat: 'minecraft:gold_ingot' },
        { id: 'minecraft:diamond_horse_armor', mat: 'minecraft:diamond' }
    ];

    horseTiers.forEach(tier => {
        // 1. Remove the old recipe that required armor pieces
        event.remove({ output: tier.id });

        // 2. Add the new recipe using only the base material and wool
        // This follows the pattern in your screenshots but replaces armor slots with the material (M)
        event.shaped(tier.id, [
            '  M', 
            'MWM', 
            'M M'
        ], {
            M: tier.mat,
            W: 'minecraft:white_wool'
        });
    });

    // Handle Leather Horse Armor separately if needed (it already uses leather)
    event.remove({ output: 'minecraft:leather_horse_armor' });
    event.shaped('minecraft:leather_horse_armor', [
        '  L', 
        'LWL', 
        'L L'
    ], {
        L: 'minecraft:leather',
        W: 'minecraft:white_wool'
    });
});