ServerEvents.recipes(event => {
  // =========================================
  // Create Block/Item Recipes
  // =========================================

  // Item Filter
  event
    .shaped("create:filter", [
      "ABA"
    ], 
    {
      A: "#forge:nuggets/zinc",
      B: "undergarden:mushroom_veil",
    })
    .id("create:crafting/kinetics/filter");

  // Attribute Filter
  event
    .shaped("create:attribute_filter", [
      "ABA"
    ], 
    {
      A: "create_confectionery:white_chocolate_nugget",
      B: "undergarden:mushroom_veil",
    })
    .id("create:crafting/kinetics/attribute_filter");

  // Remove "standard" recipe for Electron Tube
  event.remove({ id: "create:crafting/materials/electron_tube" });

  // Remove "standard" recipe for Precision Mechanism
  event.remove({ id: "create:sequenced_assembly/precision_mechanism" });

  // Thermal Press Recipes for Cogs
  event.recipes.thermal
    .press("create:cogwheel", ["#minecraft:planks", "thermal:press_gear_die"])
    .energy(1000);
  event.recipes.thermal
    .press("create:large_cogwheel", [
      "#minecraft:logs",
      "thermal:press_gear_die",
    ])
    .energy(1000);

  // Replacing Brass Sheets and Ingots with White Chocolate

  event.replaceInput(
    {},
    "create:brass_sheet",
    "create_confectionery:white_chocolate_sheet"
  );
  event.replaceInput(
    {},
    "create:brass_ingot",
    "create_confectionery:bar_of_white_chocolate"
  );
  event.replaceInput(
    {},
    "create:brass_block",
    "create_confectionery:full_white_chocolate_bar"
  );
  event.replaceInput(
    {},
    "create:brass_nugget",
    "create_confectionery:white_chocolate_nugget"
  );
  event.replaceInput(
    {},
    "create:brass_ingot",
    "create_confectionery:bar_of_white_chocolate"
  );

  // Replacing Stripped Wood with Gingerbread Blocks (Brass Casing recipe)
  event.remove({
    id: "create:item_application/brass_casing_from_log_using_deployer",
  });
  event.remove({ id: "create:item_application/brass_casing_from_log" });
  event.replaceInput(
    { output: "create:brass_casing" },
    ["#forge:stripped_wood", "#forge:stripped_logs"],
    "create_confectionery:gingerbread_block"
  );

  // White Chocolate Casing Spout Recipe
  event.recipes.create.filling("create:brass_casing", [
    Fluid.of("create_confectionery:white_chocolate", 250),
    "create_confectionery:gingerbread_block",
  ]);

  // Replacing Copper Sheets and Ingots with Caramel
  event.replaceInput(
    [{ output: "create:fluid_pipe" }, { output: "create:copper_casing" }],
    "#forge:ingots/copper",
    "create_confectionery:bar_of_caramel"
  );
  event.replaceInput(
    [{ mod: "create" }],
    "#forge:plates/copper",
    "create_confectionery:caramel_sheet"
  );

  // Replacing Stripped Wood with Crabbers Delight stuff (Copper Casing recipe)
  event.replaceInput(
    { output: "create:copper_casing" },
    ["#forge:stripped_wood", "#forge:stripped_logs"],
    [
      /^crabbersdelight:.*barrel$/,
      "crabbersdelight:nautilus_shell_block",
      "ecologics:seashell_block",
    ]
  );

  // Copper Casing Spout Recipe
  event.recipes.create.filling('create:copper_casing', [
    Fluid.of("create_confectionery:caramel", 250),
    [
      /^crabbersdelight:.*barrel$/,
      "crabbersdelight:nautilus_shell_block",
      "ecologics:seashell_block",
    ],
  ]);

  // Removing Early Game Andesite Alloy Recipes
  event.remove({ id: "create:crafting/materials/andesite_alloy_from_zinc" });
  event.remove({ id: "create:mixing/andesite_alloy_from_zinc" });
  event.remove({ id: "create_dd:industrial_iron/andesite_alloy" });
  event.remove({ id: "create_dd:industrial_iron/andesite_alloy_mixing" });
  event.replaceInput(
    { output: "create:andesite_alloy" },
    ["#forge:nuggets/iron"],
    "#forge:nuggets/tin"
  );

  // Windmill Sail
  event
    .shaped("8x create:white_sail", [
      "AB", 
      "BC"
    ], 
    {
      A: "the_bumblezone:windy_air",
      B: "#forge:rods/wooden",
      C: "create:andesite_alloy",
    })
    .id("create:crafting/kinetics/white_sail");

  // Windmill Bearing
  event
    .shaped("create:windmill_bearing", [
      "ABA", 
      "CDC", 
      "AEA"
    ], 
    {
      A: "the_bumblezone:windy_air",
      B: "#minecraft:wooden_slabs",
      C: "supplementaries:wind_vane",
      D: "#forge:stone",
      E: "create:shaft",
    })
    .id("create:crafting/kinetics/windmill_bearing");

  // Steam Engine
  event.replaceInput(
    { output: "create:steam_engine" },
    ["#forge:storage_blocks/copper"],
    "#forge:storage_blocks/constantan"
  );

  // Large Water Wheel
  event
    .shaped("create:large_water_wheel", [
      "AAA", 
      "ABA", 
      "AAA"
    ], 
    {
      A: "#decorative_blocks:palisades",
      B: "minecraft:conduit",
    })
    .id("create:crafting/kinetics/large_water_wheel");

    event
    .shaped("create:large_water_wheel", [
      "AAA", 
      "ABA", 
      "AAA"
    ], 
    {
      A: 'minecraft:nautilus_shell',
      B: 'create:water_wheel',
    })
    .id("create:crafting/kinetics/large_water_wheel2");  




    // Small Water Wheel
  event
  .shaped("create:water_wheel", [
    "AAA", 
    "ABA", 
    "AAA"
  ], 
  {
    A: "#decorative_blocks:palisades",
    B: "minecraft:heart_of_the_sea",
  })
  .id("create:crafting/kinetics/water_wheel");

  // =========================================
  // Create Diving Suit Recipes
  // =========================================

  let seqDiving = (Output, Input, Deploy1, Deploy2, TransItem) => {
    event.recipes.create
      .sequenced_assembly(Output, Input, [
        event.recipes.create.deploying(TransItem, [TransItem, Deploy1]),
        event.recipes.create.deploying(TransItem, [TransItem, Deploy2]),
        event.recipes.create.pressing(TransItem, TransItem),
      ])
      .transitionalItem(TransItem)
      .loops(1)
      .id(`create:crafting/appliances/${Output.slice(7)}`);
  };
  seqDiving(
    "create:copper_diving_helmet",
    "create_sa:copper_helmet",
    "minecraft:cyan_stained_glass_pane",
    "create:fluid_pipe",
    "create:incomplete_copper_diving_helmet"
  );
  seqDiving(
    "create:copper_diving_boots",
    "create_sa:copper_boots",
    "alexscaves:cinder_brick",
    "alexscaves:cinder_brick",
    "create:incomplete_copper_diving_boots"
  );
  seqDiving(
    "create:copper_backtank",
    "create_sa:copper_chestplate",
    "create_sa:large_filling_tank",
    "create:mechanical_pump",
    "create:incomplete_copper_backtank"
  );

  // =========================================
  // Create Machines
  // =========================================

  // Deployer uses Rats paw
  event.replaceInput(
    { output: "create:deployer" },
    "create:brass_hand",
    "rats:rat_paw"
  );

  // =========================================
  // Butchercraft Automation
  // =========================================

  event.recipes.create.cutting(
    ["butchersdelight:deadcowblockskinned", "butchersdelight:cow_hide"],
    "butchersdelight:dead_cow"
  );
  event.recipes.create.cutting(
    [
      "butchersdelight:skullcow",
      "minecraft:bone",
      Item.of("3x minecraft:beef").withChance(0.85),
      Item.of("3x qualitycrops:beef_iron").withChance(0.45),
      Item.of("3x qualitycrops:beef_gold").withChance(0.3),
      Item.of("3x qualitycrops:beef_diamond").withChance(0.15),
    ],
    "butchersdelight:deadcowblockskinned"
  );
  event.recipes.create.cutting(
    ["butchersdelight:deadsheepskinnedblock", "butchersdelight:sheephide"],
    "butchersdelight:deadsheep"
  );
  event.recipes.create.cutting(
    [
      "minecraft:bone",
      Item.of("4x minecraft:mutton").withChance(0.85),
      Item.of("3x qualitycrops:mutton_iron").withChance(0.45),
      Item.of("3x qualitycrops:mutton_gold").withChance(0.3),
      Item.of("3x qualitycrops:mutton_diamond").withChance(0.15),
    ],
    "butchersdelight:deadsheepskinnedblock"
  );
  event.recipes.create.cutting(
    ["butchersdelight:deadgoatskinnedblock", "butchersdelight:goat_fur"],
    "butchersdelight:deadgoat"
  );
  event.recipes.create.cutting(
    [
      "minecraft:bone",
      Item.of("4x minecraft:mutton").withChance(0.85),
      Item.of("3x qualitycrops:mutton_iron").withChance(0.45),
      Item.of("3x qualitycrops:mutton_gold").withChance(0.3),
      Item.of("3x qualitycrops:mutton_diamond").withChance(0.15),
    ],
    "butchersdelight:deadgoatskinnedblock"
  );
  event.recipes.create.cutting(
    [
      "butchersdelight:deadllamaskinnedblock",
      "butchersdelight:goat_fur",
      "minecraft:leather",
    ],
    "butchersdelight:deadllama"
  );
  event.recipes.create.cutting(
    [
      "minecraft:bone",
      Item.of("4x minecraft:mutton").withChance(0.85),
      Item.of("3x qualitycrops:mutton_iron").withChance(0.45),
      Item.of("3x qualitycrops:mutton_gold").withChance(0.3),
      Item.of("3x qualitycrops:mutton_diamond").withChance(0.15),
    ],
    "butchersdelight:deadllamaskinnedblock"
  );
  event.recipes.create.cutting(
    ["butchersdelight:deadstriderblockskinned", "6x minecraft:string"],
    "butchersdelight:deadstrider"
  );
  event.recipes.create.cutting(
    ["2x nethersdelight:strider_slice", "minecraft:basalt"],
    "butchersdelight:deadstriderblockskinned"
  );
  event.recipes.create.cutting(
    [
      "butchersdelight:deadrabiitskinnedblock",
      "minecraft:rabbit_hide",
      Item.of("minecraft:rabbit_foot").withChance(0.05),
    ],
    "butchersdelight:deadrabbitbrown"
  );
  event.recipes.create.cutting(
    [
      Item.of("minecraft:rabbit"),
      Item.of("2x qualitycrops:rabbit_iron").withChance(0.3),
      Item.of("2x qualitycrops:rabbit_gold").withChance(0.2),
      Item.of("2x qualitycrops:rabbit_diamond").withChance(0.1),
    ],
    "butchersdelight:deadrabiitskinnedblock"
  );
  event.recipes.create.cutting(
    ["butchersdelight:deadchickenblockskinned", "2x minecraft:feather"],
    "butchersdelight:deadchiken"
  );
  event.recipes.create.cutting(
    [
      Item.of("minecraft:chicken"),
      Item.of("2x qualitycrops:chicken_iron").withChance(0.3),
      Item.of("2x qualitycrops:chicken_gold").withChance(0.2),
      Item.of("2x qualitycrops:chicken_diamond").withChance(0.1),
    ],
    "butchersdelight:deadchickenblockskinned"
  );
  event.recipes.create.cutting(
    [
      "minecraft:bone",
      Item.of("2x minecraft:porkchop").withChance(0.85),
      Item.of("2x qualitycrops:porkchop_iron").withChance(0.3),
      Item.of("2x qualitycrops:porkchop_gold").withChance(0.2),
      Item.of("2x qualitycrops:porkchop_diamond").withChance(0.1),
      Item.of("farmersdelight:ham"),
      Item.of("qualitysdelight:ham_iron").withChance(0.15),
      Item.of("qualitysdelight:ham_gold").withChance(0.1),
      Item.of("qualitysdelight:ham_diamond").withChance(0.05),
    ],
    "butchersdelight:deadpig"
  );
  event.recipes.create.cutting(
    [
      "nethersdelight:hoglin_hide",
      "nethersdelight:hoglin_loin",
      "minecraft:bone",
      Item.of("2x minecraft:porkchop").withChance(0.85),
      Item.of("2x qualitycrops:porkchop_iron").withChance(0.3),
      Item.of("2x qualitycrops:porkchop_gold").withChance(0.2),
      Item.of("2x qualitycrops:porkchop_diamond").withChance(0.1),
      Item.of("farmersdelight:ham"),
      Item.of("qualitysdelight:ham_iron").withChance(0.15),
      Item.of("qualitysdelight:ham_gold").withChance(0.1),
      Item.of("qualitysdelight:ham_diamond").withChance(0.05),
    ],
    "butchersdelight:deadhoglin"
  );
  event.recipes.create.cutting(
    [
      "8x minecraft:stick",
      Item.of("thermal:sawdust").withChance(0.85),
      Item.of("2x thermal:sawdust").withChance(0.15),
    ],
    "#minecraft:planks"
  );
  event.recipes.create.emptying([Fluid.of("undergarden:virulent_mix_source", 1000),'minecraft:bucket'],'undergarden:virulent_mix_bucket');
});