ServerEvents.recipes((event) => {

  //Adding Node Smelting Recipes to the Jumbo Furnace.
  //Currently Disabled due to weird behavior in the Jumbo Smelting
  // const malum_node_smelting = [
  //   {input: "malum:iron_node", output: "minecraft:iron_nugget"},
  //   {input: "malum:copper_node", output: "ftbmaterials:copper_nugget"},
  //   {input: "malum:gold_node", output: "minecraft:gold_nugget"},
  //   {input: "malum:aluminum_node", output: "ftbmaterials:aluminum_nugget"},
  //   {input: "malum:nickel_node", output: "ftbmaterials:nickel_nugget"},
  //   {input: "malum:silver_node", output: "ftbmaterials:silver_nugget"},
  //   {input: "malum:tin_node", output: "ftbmaterials:tin_nugget"},
  //   {input: "malum:zinc_node", output: "ftbmaterials:zinc_nugget"},
  //   {input: "malum:osmium_node", output: "ftbmaterials:osmium_nugget"},
  //   {input: "malum:lead_node", output: "ftbmaterials:lead_nugget"},
  //   {input: "malum:uranium_node", output: "ftbmaterials:uranium_nugget"}
  // ];

  // malum_node_smelting.forEach(recipe => {
  //   event.custom({
  //     "type": "jumbofurnace:jumbo_smelting",
  //     "ingredients":
  //     [
  //       {
  //         "count": 1,
  //         "ingredient": recipe.input
  //       }
  //     ],
  //     "results": [
  //       {
  //         "id": recipe.output
  //       }
  //     ],
  //     "cookingtime": 200,
  //     "experience": 0.15
  //   }).id(`ftb:jumbofurnace/jumbo_smelting/${recipe.input.split(":")[1]}`);
  // });

  // Code template credit to @matryoshika on Discord and Appulcake on [Git](https://github.com/FTBTeam/FTB-Modpack-Issues/issues/9065)
	event.forEachRecipe({ type: 'farmersdelight:cutting'}, r => {
		let jr = JsonUtils.toObject(r.json);
		//check if this recipe uses a tooltype instead of tag
		if(jr.tool.type) {
			//Filter by action
			if(jr.tool.action == 'axe_strip' || jr.tool.action == 'axe_dig'){
				//Copy by value and change tool from type to tag
				//Farmer's Delight does not use #tag, that's already handled by the field 'tag:', just use raw tag-id
        //Also Grabbing the Input to be used later in the Recipe ID.
        let inputId = jr.ingredients[0].item ?? jr.ingredients[0].tag ?? "unknown";
				let copy = {
					type: 'farmersdelight:cutting', 
					ingredients: jr.ingredients, 
					result: jr.result, 
					tool: {tag: 'minecraft:axes'}
				};
				//remove old recipe; FD's Choppingboard supports output[{}] but KubeJS's Recipes::remove does not;
				//Filter by first output item, or use different filters to finetune removal
				event.remove({ type: 'farmersdelight:cutting', input: jr.ingredients, output: jr.result[0].id})
				//re-add the recipe again, now using tool-tags
				event.custom(copy).id(`ftb:farmersdelight/cutting/axe/${inputId.split(":")[1]}`);
			}
		}
	});

});
