ServerEvents.recipes(event => {

  event.remove({ id: 'minecraft:netherite_ingot' })
  event.remove({ id: 'minecraft:netherite_scrap' })
  event.remove({ output: 'overgeared:crude_steel' })
  event.remove({ output: 'overgeared:heated_crude_steel' })

  let smeltery = [
    'minecraft:copper_ingot',
    'minecraft:gold_ingot',
    'minecraft:iron_ingot',
    'galosphere:silver_ingot',
    'minecraft:emerald',
    'minecraft:diamond',
    'minecraft:lapis_lazuli',
    'minecraft:coal',
    'minecraft:redstone',
    'mca:rose_gold_ingot',
    'minecraft:iron_nugget',
    'minecraft:gold_nugget',
    'galosphere:silver_nugget',
    'spelunkery:copper_nugget',
    'overgeared:steel_nugget',
    'cataclysm:black_steel_nugget',
    'cataclysm:ancient_metal_nugget',
    'minecraft:iron_block',
    'minecraft:gold_block',
    'minecraft:copper_block',
    'overgeared:heated_copper_ingot',
  ]
  smeltery.forEach(o => event.remove({ output: o, type: 'minecraft:smelting' }))

  let blastery = [
    'minecraft:copper_ingot',
    'minecraft:gold_ingot',
    'minecraft:iron_ingot',
    'galosphere:silver_ingot',
    'minecraft:emerald',
    'minecraft:diamond',
    'minecraft:lapis_lazuli',
    'minecraft:netherite_scrap',
    'minecraft:netherite_ingot',
    'minecraft:coal',
    'minecraft:redstone',
    'mca:rose_gold_ingot',
    'irons_spellbooks:arcane_salvage',
    'minecraft:iron_nugget',
    'minecraft:gold_nugget',
    'galosphere:silver_nugget',
    'spelunkery:copper_nugget',
    'overgeared:steel_nugget',
    'cataclysm:black_steel_nugget',
    'cataclysm:ancient_metal_nugget',
    'minecraft:iron_block',
    'minecraft:gold_block',
    'minecraft:copper_block',
    'overgeared:heated_iron_ingot',
    'overgeared:heated_copper_ingot',
    'astrological:cracked_light_jade_tiles'
  ]
  blastery.forEach(o => event.remove({ output: o, type: 'minecraft:blasting' }))

  // LOW MELTING POINT
  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 150,
    "experience": 0.3,
    "ingredient": {
      "item": "minecraft:raw_copper"
    },
    "result": "minecraft:copper_ingot"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 150,
    "experience": 0.3,
    "ingredient": {
      "tag": "forge:ores/copper"
    },
    "result": "minecraft:copper_ingot"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 80,
    "experience": 0.3,
    "ingredient": {
      "item": "minecraft:raw_gold"
    },
    "result": "minecraft:gold_ingot"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 80,
    "experience": 0.3,
    "ingredient": {
      "item": "mca:rose_gold_dust"
    },
    "result": "mca:rose_gold_ingot"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 80,
    "experience": 0.3,
    "ingredient": {
      "tag": "forge:ores/gold"
    },
    "result": "minecraft:gold_ingot"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 70,
    "experience": 0.3,
    "ingredient": {
      "item": "galosphere:raw_silver"
    },
    "result": "galosphere:silver_ingot"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 70,
    "experience": 0.3,
    "ingredient": {
      "item": "fantasia:silver_ores"
    },
    "result": "galosphere:silver_ingot"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 80,
    "experience": 0.3,
    "ingredient": {
      "item": "coinsje:gold_coin"
    },
    "result": "minecraft:gold_nugget"
  })

  // HIGH MELTING POINT
  event.blasting('minecraft:iron_ingot', 'minecraft:raw_iron').xp(0.7).cookingTime(150)
  event.blasting('overgeared:heated_crude_steel', 'overgeared:crude_steel').xp(0.7).cookingTime(300)
  let blacksteel = [
    'cataclysm:black_steel_sword',
    'cataclysm:black_steel_pickaxe',
    'cataclysm:black_steel_axe',
    'cataclysm:black_steel_shovel',
    'cataclysm:black_steel_hoe',
    'cataclysm:black_steel_targe'
  ]
  blacksteel.forEach(o => event.blasting('cataclysm:black_steel_ingot', o).xp(0.7).cookingTime(400))

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "tag": "forge:ores/iron",
        "count": 1
      }
    ],
    "result": {
      "item": "minecraft:iron_ingot",
      "count": 1
    },
    "smeltingTime": 140,
    "fuelPerTick": 1,
    "requiredTier": 1
  })

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "tag": "forge:ores/iron",
        "count": 1
      },
      {
        "tag": "forge:ores/iron",
        "count": 1
      }
    ],
    "result": {
      "item": "minecraft:iron_ingot",
      "count": 2
    },
    "smeltingTime": 140,
    "fuelPerTick": 1,
    "requiredTier": 1
  })

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "item": "minecraft:raw_iron",
        "count": 3
      },
      {
        "item": "minecraft:coal",
        "count": 1
      }
    ],
    "result": {
      "item": "overgeared:crude_steel",
      "count": 1
    },
    "smeltingTime": 600,
    "fuelPerTick": 1,
    "requiredTier": 1
  })

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "item": "minecraft:raw_iron",
        "count": 3
      },
      {
        "item": "minecraft:coal",
        "count": 1
      }
    ],
    "result": {
      "item": "overgeared:crude_steel",
      "count": 2
    },
    "smeltingTime": 300,
    "fuelPerTick": 1,
    "requiredTier": 2
  })

  // VERY HIGH MELTING POINT

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "tag": "forge:ores/iron",
        "count": 1
      }
    ],
    "result": {
      "item": "minecraft:iron_ingot",
      "count": 1
    },
    "smeltingTime": 100,
    "fuelPerTick": 1,
    "requiredTier": 2
  })

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "tag": "forge:ores/iron",
        "count": 1
      },
      {
        "tag": "forge:ores/iron",
        "count": 1
      }
    ],
    "result": {
      "item": "minecraft:iron_ingot",
      "count": 2
    },
    "smeltingTime": 100,
    "fuelPerTick": 1,
    "requiredTier": 2
  })

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "item": "minecraft:ancient_debris",
        "count": 1
      }
    ],
    "result": {
      "item": "minecraft:netherite_scrap",
      "count": 1
    },
    "smeltingTime": 600,
    "fuelPerTick": 1,
    "requiredTier": 2
  })

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "item": "minecraft:ancient_debris",
        "count": 1
      },
      {
        "item": "minecraft:ancient_debris",
        "count": 1
      }
    ],
    "result": {
      "item": "minecraft:netherite_scrap",
      "count": 2
    },
    "smeltingTime": 600,
    "fuelPerTick": 1,
    "requiredTier": 2
  })

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "item": "kubejs:netherite_alloy",
        "count": 1
      },
      {
        "item": "minecraft:blaze_powder",
        "count": 3
      }
    ],
    "result": {
      "item": "kubejs:unfinished_netherite_ingot",
      "count": 1
    },
    "smeltingTime": 1200,
    "fuelPerTick": 1,
    "requiredTier": 2
  })

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "item": "irons_spellbooks:arcane_debris",
        "count": 1
      }
    ],
    "result": {
      "item": "irons_spellbooks:arcane_salvage",
      "count": 1
    },
    "smeltingTime": 600,
    "fuelPerTick": 1,
    "requiredTier": 2
  })

  event.custom({
    "type": "alloy_smelter:smelting",
    "ingredients": [
      {
        "item": "irons_spellbooks:arcane_debris",
        "count": 1
      },
      {
        "item": "irons_spellbooks:arcane_debris",
        "count": 1
      }
    ],
    "result": {
      "item": "irons_spellbooks:arcane_salvage",
      "count": 2
    },
    "smeltingTime": 600,
    "fuelPerTick": 3,
    "requiredTier": 2
  })

  // HEATING RECIPES
  event.blasting('overgeared:heated_iron_ingot', 'minecraft:iron_ingot').xp(0.7).cookingTime(100)

  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 150,
    "experience": 0.0,
    "ingredient": {
      "item": "minecraft:copper_ingot"
    },
    "result": "overgeared:heated_copper_ingot"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 200,
    "experience": 0.0,
    "ingredient": {
      "item": "minecraft:iron_ingot"
    },
    "result": "overgeared:heated_iron_ingot"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "material",
    "cookingtime": 300,
    "experience": 0.0,
    "ingredient": {
      "item": "overgeared:steel_ingot"
    },
    "result": "overgeared:heated_steel_ingot"
  })

  // CLAYWORKS COMPAT

  event.custom({
    "type": "clayworks:baking",
    "category": "blocks",
    "cookingtime": 100,
    "experience": 0.1,
    "ingredient": {
      "item": "minecraft:bricks"
    },
    "result": "twigs:cracked_bricks"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "blocks",
    "cookingtime": 100,
    "experience": 0.1,
    "ingredient": {
      "item": "twigs:silt_bricks"
    },
    "result": "twigs:cracked_silt_bricks"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "blocks",
    "cookingtime": 100,
    "experience": 0.1,
    "ingredient": {
      "item": "astrological:light_jade_tiles"
    },
    "result": "astrological:cracked_light_jade_tiles"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "blocks",
    "cookingtime": 100,
    "experience": 0.1,
    "ingredient": {
      "item": "minecraft:smooth_stone"
    },
    "result": "bbb:polished_stone"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "blocks",
    "cookingtime": 100,
    "experience": 0.1,
    "ingredient": {
      "item": "quark:soul_sandstone"
    },
    "result": "quark:smooth_soul_sandstone"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "blocks",
    "cookingtime": 100,
    "experience": 0.1,
    "ingredient": {
      "item": "supplementaries:ash"
    },
    "result": "supplementaries:ash_brick"
  })

  event.custom({
    "type": "clayworks:baking",
    "category": "blocks",
    "cookingtime": 100,
    "experience": 0.1,
    "ingredient": {
      "item": "twigs:silt_ball"
    },
    "result": "twigs:silt_brick"
  })

  let polishedtwigs = [
    "calcite",
    "rhyolite",
    "bloodstone",
    "schist"
  ];

  polishedtwigs.forEach(type => {

    event.custom({
      "type": "clayworks:baking",
      "category": "blocks",
      "cookingtime": 100,
      "experience": 0.1,
      "ingredient": {
        "item": `twigs:polished_${type}_bricks`
      },
      "result": `twigs:cracked_polished_${type}_bricks`
    })
  });

  // NETHERITE ALLOYING

  event.custom({
    "type": "miningmaster:forging_recipe",
    "gems": [
      { "item": "minecraft:netherite_scrap" },
      { "item": "minecraft:netherite_scrap" },
      { "item": "minecraft:netherite_scrap" },
      { "item": "minecraft:netherite_scrap" },
      { "item": "minecraft:blaze_powder" },
      { "item": "cataclysm:black_steel_ingot" },
      { "item": "cataclysm:black_steel_ingot" },
      { "item": "cataclysm:black_steel_ingot" },
      { "item": "cataclysm:black_steel_ingot" },
    ],
    "catalyst": { "item": "minecraft:diamond" },
    "result": { "item": "kubejs:netherite_alloy" }
  })

});