onEvent('recipes', event => {

    const id_prefix = 'primutils:kubejs/milling';

    const recipes = [
        {
            input: 'minecraft:wheat',
            output: [{result:'create:wheat_flour'}],
            total_progress: 1,
            id: 'wheat_flour'
        },
        {
            input: 'farmersdelight:tree_bark',
            output: [{result:'emendatusenigmatica:wood_dust',chance:75}],
            total_progress: 2,
            id: 'wood_dust'
        },
        {
            input: '#quark:crystal_cluster',
            output: [{result:'eidolon:enchanted_ash'},{result:'eidolon:enchanted_ash',chance:80}],
            total_progress: 2,
            id: 'enchanted_ash'
        },
        {
            input: 'naturesaura:gold_leaf',
            output: [{result:'naturesaura:gold_powder'}],
            total_progress: 1,
            id: 'gold_powder'
        }
    ];

    recipes.forEach(recipe => {
        recipe.type = 'primutils:milling';
        recipe.input = Ingredient.of(recipe.input).toJson();
        recipe.output = recipe.output.map((out) => {
            out.result = Item.of(out.result).toResultJson();
            if(!out.chance){
                out.chance = 100;
            }
            return out;
        });
        event.custom(recipe).id(`${id_prefix}/${recipe.id}`);
    })

})