ServerEvents.recipes((event) => {
  // Milling
  event.remove({ type: "create:milling", input: "minecraft:gravel" });
  event.remove({ type: "create:milling", input: "minecraft:sand" });
  event.remove({ output: 'create:empty_blaze_burner' })
  event.remove({ output: 'create:blaze_burner' })
  event.remove({ output: 'create:mechanical_crafter' })
  event.remove({ output: 'create:deployer' })

  event.shaped('3x create:mechanical_crafter', [' W ', ' B ', ' C '], { B: 'create:brass_casing', C: 'minecraft:crafting_table', W: 'create:cogwheel' })
  event.shaped('create:deployer', [' S ', ' B ', ' H '], { S: 'create:shaft', B: 'create:brass_casing', H: 'create:brass_hand' })

  event.recipes.create.milling(
    [
      Item.of("create:crushed_raw_iron").withChance(0.25),
      Item.of("create:crushed_raw_copper").withChance(0.25),
      Item.of("create:crushed_raw_zinc").withChance(0.25),
      Item.of("minecraft:coal").withChance(0.35),
    ],
    "minecraft:gravel"
  );
  event.recipes.create.milling(
    [
      Item.of("minecraft:kelp").withChance(0.2),
      Item.of("minecraft:glowstone_dust").withChance(0.2),
      Item.of("exdeorum:dust").withChance(0.4),
    ],
    Item.of("minecraft:sand")
  );
  event.recipes.create.milling(
    [
      Item.of("minecraft:quartz").withChance(0.2),
      Item.of("minecraft:blaze_powder").withChance(0.2),
      Item.of("minecraft:magma_cream").withChance(0.2),
    ],
    Item.of("exdeorum:crushed_netherrack")
  );

  // Molten Metals
  event.recipes.create
    .mixing(Fluid.of("tconstruct:molten_iron", 1000), [
      Item.of("minecraft:iron_ingot", 8),
    ])
    .heated();
  event.recipes.create
    .mixing(Fluid.of("tconstruct:molten_copper", 1000), [
      Item.of("minecraft:copper_ingot", 8),
    ])
    .heated();
  event.recipes.create
    .mixing(Fluid.of("tconstruct:molten_zinc", 1000), [
      Item.of("create:zinc_ingot", 8),
    ])
    .heated();
  event.recipes.create
    .mixing(Fluid.of("kubejs:molten_coal", 1000), [
      Item.of("minecraft:coal", 16),
    ])
    .heated();

  // Basic Core Assemblys

  event
    .custom({
      type: "create:sequenced_assembly",
      ingredient: { item: "kubejs:basic_resource_shell" },
      loops: 1,
      results: [{ item: "kubejs:iron_resource_core" }],
      sequence: [
        {
          type: "create:filling",
          ingredients: [
            { item: "kubejs:incomplete_basic" },
            { fluid: "tconstruct:molten_iron", amount: 500 },
          ],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
        {
          type: "create:filling",
          ingredients: [
            { item: "kubejs:incomplete_basic" },
            { fluid: "tconstruct:molten_iron", amount: 500 },
          ],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
        {
          type: "create:pressing",
          ingredients: [{ item: "kubejs:incomplete_basic" }],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
      ],
      transitionalItem: { item: "kubejs:incomplete_basic" },
    })
    .id("kubejs:iron_resource_core");

  event
    .custom({
      type: "create:sequenced_assembly",
      ingredient: { item: "kubejs:basic_resource_shell" },
      loops: 1,
      results: [{ item: "kubejs:copper_resource_core" }],
      sequence: [
        {
          type: "create:filling",
          ingredients: [
            { item: "kubejs:incomplete_basic" },
            { fluid: "tconstruct:molten_copper", amount: 500 },
          ],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
        {
          type: "create:filling",
          ingredients: [
            { item: "kubejs:incomplete_basic" },
            { fluid: "tconstruct:molten_copper", amount: 500 },
          ],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
        {
          type: "create:pressing",
          ingredients: [{ item: "kubejs:incomplete_basic" }],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
      ],
      transitionalItem: { item: "kubejs:incomplete_basic" },
    })
    .id("kubejs:copper_resource_core");

  event
    .custom({
      type: "create:sequenced_assembly",
      ingredient: { item: "kubejs:basic_resource_shell" },
      loops: 1,
      results: [{ item: "kubejs:coal_resource_core" }],
      sequence: [
        {
          type: "create:filling",
          ingredients: [
            { item: "kubejs:incomplete_basic" },
            { fluid: "kubejs:molten_coal", amount: 500 },
          ],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
        {
          type: "create:filling",
          ingredients: [
            { item: "kubejs:incomplete_basic" },
            { fluid: "kubejs:molten_coal", amount: 500 },
          ],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
        {
          type: "create:pressing",
          ingredients: [{ item: "kubejs:incomplete_basic" }],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
      ],
      transitionalItem: { item: "kubejs:incomplete_basic" },
    })
    .id("kubejs:coal_resource_core");

  event
    .custom({
      type: "create:sequenced_assembly",
      ingredient: { item: "kubejs:basic_resource_shell" },
      loops: 1,
      results: [{ item: "kubejs:zinc_resource_core" }],
      sequence: [
        {
          type: "create:filling",
          ingredients: [
            { item: "kubejs:incomplete_basic" },
            { fluid: "tconstruct:molten_zinc", amount: 500 },
          ],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
        {
          type: "create:filling",
          ingredients: [
            { item: "kubejs:incomplete_basic" },
            { fluid: "tconstruct:molten_zinc", amount: 500 },
          ],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
        {
          type: "create:pressing",
          ingredients: [{ item: "kubejs:incomplete_basic" }],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
      ],
      transitionalItem: { item: "kubejs:incomplete_basic" },
    })
    .id("kubejs:zinc_resource_core");

  event
    .custom({
      type: "create:sequenced_assembly",
      ingredient: { item: "kubejs:basic_resource_shell" },
      loops: 1,
      results: [{ item: "kubejs:basic_blob" }],
      sequence: [
        {
          type: "create:deploying",
          ingredients: [
            {
              item: "kubejs:incomplete_basic",
            },
            {
              item: "kubejs:iron_resource_core",
            },
          ],
          results: [
            {
              item: "kubejs:incomplete_basic",
            },
          ],
        },
        {
          type: "create:deploying",
          ingredients: [
            {
              item: "kubejs:incomplete_basic",
            },
            {
              item: "kubejs:copper_resource_core",
            },
          ],
          results: [
            {
              item: "kubejs:incomplete_basic",
            },
          ],
        },
        {
          type: "create:deploying",
          ingredients: [
            {
              item: "kubejs:incomplete_basic",
            },
            {
              item: "kubejs:coal_resource_core",
            },
          ],
          results: [
            {
              item: "kubejs:incomplete_basic",
            },
          ],
        },
        {
          type: "create:deploying",
          ingredients: [
            {
              item: "kubejs:incomplete_basic",
            },
            {
              item: "kubejs:zinc_resource_core",
            },
          ],
          results: [
            {
              item: "kubejs:incomplete_basic",
            },
          ],
        },
        {
          type: "create:pressing",
          ingredients: [{ item: "kubejs:incomplete_basic" }],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
      ],
      transitionalItem: { item: "kubejs:incomplete_basic" },
    })
    .id("kubejs:basic_blob");

  event
    .custom({
      type: "create:sequenced_assembly",
      ingredient: { item: "kubejs:basic_blob" },
      loops: 10,
      results: [{ item: "kubejs:basic_shard" }],
      sequence: [
        {
          type: "create:pressing",
          ingredients: [{ item: "kubejs:incomplete_basic" }],
          results: [{ item: "kubejs:incomplete_basic" }],
        },
      ],
      transitionalItem: { item: "kubejs:incomplete_basic" },
    })
    .id("kubejs:basic_shard");

    // TIER 2
    event.recipes.create.crushing(
      [
        Item.of("minecraft:lapis_lazuli"),
        Item.of("create:crushed_raw_gold"),
        Item.of("minecraft:redstone"),
      ],
      "kubejs:basic_shard"
    );
    // Tier 3
    event.recipes.create.crushing([
      Item.of("thermal:tin_ingot"),
      Item.of("thermal:nickel_ingot"),
      Item.of("thermal:silver_ingot"),
      Item.of("thermal:lead_ingot"),
      Item.of("minecraft:diamond"),
    ],
    "kubejs:magic_shard"
  )
  event.recipes.create.mechanical_crafting('kubejs:creative_core', [
    '    1    ',
    '   234   ',
    '  56789  ',
    ' ABCDEFG ',
    'HIJKLMNOP',
    ' QRSTUVW ',
    '  XYZab  ',
    '   cde   ',
    '    f    '
  ],
  {
    1: 'kubejs:iron_resource_core',
    2: 'kubejs:coal_resource_core',
    3: 'kubejs:copper_resource_core',
    4: 'kubejs:zinc_resource_core',
    5: 'kubejs:gold_resource_core',
    6: 'kubejs:lapis_resource_core',
    7: 'kubejs:redstone_resource_core',
    8: 'kubejs:source_resource_core',
    9: 'kubejs:blood_resource_core',
    A: 'kubejs:lead_resource_core',
    B: 'kubejs:tin_resource_core',
    C: 'kubejs:silver_resource_core',
    D: 'kubejs:nickel_resource_core',
    E: 'kubejs:diamond_resource_core',
    F: 'kubejs:energized_steel_core',
    G: 'kubejs:blazing_resource_core',
    H: 'kubejs:niotic_resource_core',
    I: 'kubejs:spirited_resource_core',
    J: 'kubejs:nitro_resource_core',
    K: 'kubejs:uraninite_resource_core',
    L: 'extendedcrafting:ultimate_singularity',
    M: 'kubejs:manasteel_resource_core',
    N: 'kubejs:terrasteel_resource_core',
    O: 'kubejs:elementium_resource_core',
    P: 'kubejs:gaia_resource_core',
    Q: 'kubejs:alfsteel_resource_core',
    R: 'kubejs:osmium_resource_core',
    S: 'kubejs:infused_alloy_resource_core',
    T: 'kubejs:reinforced_alloy_resource_core',
    U: 'kubejs:atomic_alloy_resource_core',
    V: 'kubejs:antimatter_resource_core',
    W: 'kubejs:quartz_resource_core',
    X: 'kubejs:netherite_resource_core',
    Y: 'kubejs:uranium_resource_core',
    Z: 'kubejs:steel_resource_core',
    a: 'kubejs:cobalt_resource_core',
    b: 'kubejs:certus_resource_core',
    c: 'kubejs:flux_dust_resource_core',
    d: 'kubejs:refined_glowstone_resource_core', 
    e: 'kubejs:refined_obsidian_resource_core',
    f: 'kubejs:fluix_resource_core'
  })
});
