events.listen("recipes", function (e) {
  function Armement(catalyseur, precedent, nouveau, type) {
    e.remove({ id: nouveau + type });
    e.remove({ id: "quark:tweaks/crafting/utility/tools/stone_" + type });
    e.custom({
      type: "minecraft:smithing",
      base: { item: precedent + type },
      addition: { tag: catalyseur },
      result: { item: nouveau + type },
    });
  }
  var outil = ["sword", "shovel", "pickaxe", "axe", "hoe"];
  outil.forEach((S) => {
    Armement("forge:cobblestone", "minecraft:wooden_", "minecraft:stone_", S);
    Armement("forge:ingots/iron", "minecraft:stone_", "minecraft:iron_", S);
    Armement("forge:ingots/gold", "minecraft:iron_", "minecraft:golden_", S);
    Armement(
      "forge:gems/diamond",
      "minecraft:golden_",
      "minecraft:diamond_",
      S
    );
  });
});
