onEvent('recipes', (event) => {
    
    const id_prefix = 'apotheosis:spawner';

    const recipes = [
        {
            mainhand: 'create:shadow_steel',
            changes: [
                {
                    type: 'boolean',
                    id: 'ignore_light'
                }
            ],
            id: 'ignore_light'
        },
        {
            mainhand: '#minecraft:wool',
            changes: [
                {
                    type: 'boolean',
                    id: 'silent'
                }
            ],
            id: 'silent'
        },
        {
            mainhand: 'naturesaura:token_terror',
            changes: [
                {
                    type: 'boolean',
                    id: 'no_ai'
                }
            ],
            id: 'no_ai'
        },
        {
            mainhand: 'create:electron_tube',
            changes: [
                {
                    type: 'boolean',
                    id: 'redstone_control'
                }
            ],
            id: 'redstone_control'
        },
        {
            mainhand: 'astralsorcery:shifting_star',
            changes: [
                {
                    type: 'boolean',
                    id: 'ignore_players'
                }
            ],
            id: 'ignore_players'
        },
        {
            mainhand: 'minecraft:nether_star',
            changes: [
                {
                    type: 'boolean',
                    id: 'ignore_players'
                }
            ],
            id: 'ignore_players'
        },
        {
            mainhand: 'minecraft:dragon_egg',
            changes: [
                {
                    type: 'boolean',
                    id: 'ignore_conditions'
                }
            ],
            id: 'ignore_conditions'
        },
        {
            mainhand: Item.of('naturesaura:effect_powder', '{effect:"naturesaura:animal"}'),
            changes: [
                {
                    type: 'integer',
                    id: 'spawn_count',
                    value: 1,
                    max: 8,
                    min: -1
                }
            ],
            id: 'spawn_count'
        },
        {
            mainhand: 'bloodmagic:mundanepowercatalyst',
            changes: [
                {
                    type: 'integer',
                    id: 'spawn_count',
                    value: 1,
                    max: 16,
                    min: -1
                }
            ],
            id: 'spawn_count_advanced'
        },
        {
            mainhand: 'minecraft:piston',
            changes: [
                {
                    type: 'integer',
                    id: 'max_nearby_entities',
                    value: 2,
                    max: 16,
                    min: -1
                }
            ],
            id: 'max_nearby'
        },
        {
            mainhand: 'bloodmagic:reagentsuppression',
            changes: [
                {
                    type: 'integer',
                    id: 'max_nearby_entities',
                    value: 2,
                    max: 32,
                    min: -1
                }
            ],
            id: 'max_nearby_advanced'
        },
        {
            mainhand: 'create:bar_of_chocolate',
            changes: [
                {
                    type: 'integer',
                    id: 'min_delay',
                    value: -10,
                    max: -1,
                    min: 100
                }
            ],
            id: 'min_delay'
        },
        {
            mainhand: 'bloodmagic:bow_velocity_anointment_2',
            changes: [
                {
                    type: 'integer',
                    id: 'min_delay',
                    value: -10,
                    max: -1,
                    min: 20
                }
            ],
            id: 'min_delay_advanced'
        },
        {
            mainhand: 'naturesaura:token_rage',
            changes: [
                {
                    type: 'integer',
                    id: 'max_delay',
                    value: -10,
                    max: -1,
                    min: 400
                }
            ],
            id: 'max_delay'
        },
        {
            mainhand: 'bloodmagic:vengefulcatalyst',
            changes: [
                {
                    type: 'integer',
                    id: 'max_delay',
                    value: -10,
                    max: -1,
                    min: 20
                }
            ],
            id: 'max_delay_advanced'
        },
        {
            mainhand: 'naturesaura:eye',
            changes: [
                {
                    type: 'integer',
                    id: 'req_player_range',
                    value: 2,
                    max: 32,
                    min: -1
                }
            ],
            id: 'player_range'
        },
        {
            mainhand: 'atum:lantern_of_atem',
            changes: [
                {
                    type: 'integer',
                    id: 'req_player_range',
                    value: 2,
                    max: 48,
                    min: -1
                }
            ],
            id: 'player_range_advanced'
        },
        {
            mainhand: '#mob_grinding_utils:spawner_upgrades',
            changes: [
                {
                    type: 'integer',
                    id: 'spawn_range',
                    value: 1,
                    max: 16,
                    min: -1
                }
            ],
            id: 'spawn_range'
        },
        {
            mainhand: 'bloodmagic:reagentteleposition',
            changes: [
                {
                    type: 'integer',
                    id: 'spawn_range',
                    value: 1,
                    max: 32,
                    min: -1
                }
            ],
            id: 'spawn_range_advanced'
        },
    ];

    recipes.forEach(recipe => {

        event.custom({
            type: 'apotheosis:spawner_modifier',
            mainhand: Ingredient.of(recipe.mainhand).toJson(),
            offhand: Ingredient.of('integrateddynamics:variable_transformer_input').toJson(),
            consumes_offhand: true,
            stat_changes: recipe.changes.map(change => {
                if(change.type=='boolean') {
                    return { id: change.id, value: true };
                } else {
                    return { id: change.id, value: change.value, max: change.max, min: change.min };
                }
            })
        }).id(`${id_prefix}/${recipe.id}`);

        event.custom({
            type: 'apotheosis:spawner_modifier',
            mainhand: Ingredient.of(recipe.mainhand).toJson(),
            offhand: Ingredient.of('integrateddynamics:variable_transformer_output').toJson(),
            consumes_offhand: true,
            stat_changes: recipe.changes.map(change => {
                if(change.type=='boolean') {
                    return { id: change.id, value: false };
                } else {
                    return { id: change.id, value: -change.value, max: change.max, min: change.min };
                }
            })
        }).id(`${id_prefix}/${recipe.id}_inverted`);

    })

});