events.listen("recipes", function (e) {
  //creation craft essence
  function changementGraine(name) {
    e.remove({ id: "mysticalagriculture:essence/common/" + name + "_ingot" }),
      e.custom({
        type: "cucumber:shaped_no_mirror",
        conditions: [{}],
        pattern: ["EEE", "E E", "EEE"],
        key: {
          E: {
            item: "mysticalagriculture:" + name + "_essence",
          },
        },
        result: {
          item: "alltheores:" + name + "_ingot",
          count: 4,
        },
      });
  }

  e.remove({ id: "mysticalagriculture:essence/common/yellorium_ingot" }),
    e.custom({
      type: "cucumber:shaped_no_mirror",
      conditions: [{}],
      pattern: ["EEE", "E E", "EEE"],
      key: {
        E: {
          item: "mysticalagriculture:yellorium_essence",
        },
      },
      result: {
        item: "bigreactors:yellorium_ingot",
        count: 4,
      },
    });

  changementGraine("copper");
  changementGraine("tin");
  changementGraine("aluminum");
  changementGraine("lead");
  changementGraine("nickel");
  changementGraine("osmium");
  changementGraine("platinum");
  changementGraine("silver");
  changementGraine("uranium");
});
