ServerEvents.recipes(event => {
    let early_tool = (tool, source, result, resultNum) => {
        event.recipes.kubejs.shapeless(Item.of(result, resultNum), // arg 1: output
            [
                tool,
                source
            ]
        )
        .damageIngredient(tool,60)
    }
    
    let iron_tool = (tool, source, result, resultNum) => {
        event.recipes.kubejs.shapeless(Item.of(result, resultNum), // arg 1: output
            [
                tool,
                source
            ]
        )
        .damageIngredient(tool,40)
    }
    
    let late_tool = (tool, source, result, resultNum) => {
        event.recipes.kubejs.shapeless(Item.of(result, resultNum), // arg 1: output
            [
                tool,
                source
            ]
        )
        .damageIngredient(tool,20)
    }
  
    //Now we can make many 'resurvitem' recipes without typing that huge block over and over!
    early_tool('#minecraft:early_axes', '#minecraft:logs', 'minecraft:stick', 2)
    early_tool('#minecraft:early_pickaxes', '#minecraft:stone_crafting_materials', 'minecraft:flint', 2)
    early_tool('#minecraft:early_shovels', 'minecraft:gravel', 'minecraft:flint', 2)
    early_tool('#minecraft:early_swords', '#minecraft:wool', 'minecraft:string', 4)

    iron_tool('minecraft:iron_axe', '#minecraft:logs', 'minecraft:stick', 4)
    iron_tool('minecraft:iron_pickaxe', '#minecraft:stone_crafting_materials', 'minecraft:flint', 4)
    iron_tool('minecraft:iron_shovel', 'minecraft:gravel', 'minecraft:flint', 4)
    iron_tool('minecraft:iron_sword', '#minecraft:wool', 'minecraft:string', 8)

    late_tool('#minecraft:late_axes', '#minecraft:logs', 'minecraft:stick', 6)
    late_tool('#minecraft:late_pickaxes', '#minecraft:stone_crafting_materials', 'minecraft:flint', 6)
    late_tool('#minecraft:late_shovels', 'minecraft:gravel', 'minecraft:flint', 6)
    late_tool('#minecraft:late_swords', '#minecraft:wool', 'minecraft:string', 12)
})