let draconicFusion = (event, output, craftingTier, energy, middleItem, ingredientList) => {
    //crafting tier: 1.draconium, 2.wyvern, 3.draconic, 4.chaotic
    let tiers = ['WYVERN', 'DRACONIC', 'CHAOTIC']
    event.custom({
      type: 'draconicevolution:fusion_crafting',
      result: { item: output },
      catalyst: { item: middleItem },
      total_energy: energy,
      tier: (craftingTier > 4 && craftingTier <= 1) ? 'DRACONIUM' : tiers[craftingTier - 2],
      ingredients: ingredientList.map(item => (item.charAt(0) === '#') ? { tag: item.substring(1) } : { item: item })
    }).id(`kubejs:fusion_crafting/${output.replace(':', '/')}`)
  }
 
onEvent('recipes', (event) => {

    event.remove({id: 'allthemodium:main/vibranium_helmet'})
    event.remove({id: 'allthemodium:main/vibranium_chestplate'})
    event.remove({id: 'allthemodium:main/vibranium_leggings'})
    event.remove({id: 'allthemodium:main/vibranium_boots'})
  
    event.remove({id: 'allthemodium:main/unobtainium_helmet'})
    event.remove({id: 'allthemodium:main/unobtainium_chestplate'})
    event.remove({id: 'allthemodium:main/unobtainium_leggings'})
    event.remove({id: 'allthemodium:main/unobtainium_boots'})

    event.remove({id: 'creativewirelesstransmitter:creative_wireless_transmitter'})
//Refined Storage
draconicFusion(event, 'refinedstorage:creative_controller', 3, 35600000, 'refinedstorage:controller', [
  'extrastorage:neural_processor',
  'extrastorage:neural_processor',
  'extrastorage:neural_processor',
  'extrastorage:neural_processor',
  'extradisks:withering_processor',
  'extradisks:withering_processor',
  'refinedstorage:quartz_enriched_iron_block',
  'atmadditions:atm_star_shard'
])
draconicFusion(event, 'refinedstorage:creative_portable_grid', 3, 35600000, 'refinedstorage:portable_grid', [
  'extrastorage:neural_processor',
  'extrastorage:neural_processor',
  'extrastorage:neural_processor',
  'extrastorage:neural_processor',
  'extradisks:withering_processor',
  'extradisks:withering_processor',
  'refinedstorage:quartz_enriched_iron_block',
  'atmadditions:atm_star_shard'
])
draconicFusion(event, 'universalgrid:creative_wireless_universal_grid', 3, 35600000, 'universalgrid:wireless_universal_grid', [
  'refinedstorage:quartz_enriched_iron',
  'refinedstorage:quartz_enriched_iron',
  'refinedstorage:quartz_enriched_iron',
  'refinedstorage:quartz_enriched_iron',
  'refinedstorage:quartz_enriched_iron',
  'refinedstorage:quartz_enriched_iron',
  'refinedstorage:wireless_transmitter',
  'atmadditions:atm_star_shard'
])

draconicFusion(event, 'creativewirelesstransmitter:creative_wireless_transmitter', 3, 35600000, 'rsinfinitybooster:dimension_card', [
  'refinedstorage:wireless_transmitter',
  'refinedstorage:wireless_transmitter',
  'refinedstorage:wireless_transmitter',
  'refinedstorage:wireless_transmitter',
  'rsinfinitybooster:infinity_card',
  'rsinfinitybooster:infinity_card',
  'rsinfinitybooster:infinity_card',
  'rsinfinitybooster:infinity_card'
])
//All The Mods Additions
  draconicFusion(event, 'atmadditions:atm_star', 4, 1024000000, 'extendedcrafting:ultimate_singularity', [
    'atmadditions:dimensional_seed',
    'atmadditions:improbable_probability_device',
    'atmadditions:oblivion_shard',
    'atmadditions:pulsating_black_hole',
    'atmadditions:withers_compass',
    'atmadditions:dragon_soul',
    'atmadditions:nexium_emitter',
    'atmadditions:philosophers_fuel'
  ])
//All The Mods
  draconicFusion(event, 'allthemodium:alloy_paxel', 3, 1024000000, 'extendedcrafting:the_ultimate_block', [
    'allthemodium:alloy_sword',
    'allthemodium:alloy_shovel',
    'allthemodium:alloy_axe',
    'allthemodium:alloy_pick'
  ])

  //Vibranium Armor
  draconicFusion(event, 'allthemodium:vibranium_helmet', 2, 1024000, 'allthemodium:allthemodium_helmet', [
    'extendedcrafting:the_ultimate_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot'
  ])

  draconicFusion(event, 'allthemodium:vibranium_chestplate', 2, 1024000, 'allthemodium:allthemodium_chestplate', [
    'extendedcrafting:the_ultimate_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot'
  ])

  draconicFusion(event, 'allthemodium:vibranium_leggings', 2, 1024000, 'allthemodium:allthemodium_leggings', [
    'extendedcrafting:the_ultimate_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot'
  ])

  draconicFusion(event, 'allthemodium:vibranium_boots', 2, 1024000, 'allthemodium:allthemodium_boots', [
    'extendedcrafting:the_ultimate_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot',
    'allthemodium:vibranium_ingot'
  ])
  //Unobtainium Armor
  draconicFusion(event, 'allthemodium:unobtainium_helmet', 3, 10240000, 'allthemodium:vibranium_helmet', [
    'extendedcrafting:the_ultimate_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot'
  ])

  draconicFusion(event, 'allthemodium:unobtainium_chestplate', 3, 10240000, 'allthemodium:vibranium_chestplate', [
    'extendedcrafting:the_ultimate_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot'
  ])

  draconicFusion(event, 'allthemodium:unobtainium_leggings', 3, 10240000, 'allthemodium:vibranium_leggings', [
    'extendedcrafting:the_ultimate_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot'
  ])

  draconicFusion(event, 'allthemodium:unobtainium_boots', 3, 10240000, 'allthemodium:vibranium_boots', [
    'extendedcrafting:the_ultimate_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot',
    'allthemodium:unobtainium_ingot'
  ])
 //Alloys
  draconicFusion(event, 'allthemodium:unobtainium_allthemodium_alloy_ingot', 3, 512000, 'mysticalagradditions:creative_essence', [
    'allthemodium:allthemodium_ingot',
    'allthemodium:unobtainium_ingot'
  ])

  draconicFusion(event, 'allthemodium:unobtainium_vibranium_alloy_ingot', 3, 512000, 'mysticalagradditions:creative_essence', [
    'allthemodium:vibranium_ingot',
    'allthemodium:unobtainium_ingot'
  ])

  draconicFusion(event, 'allthemodium:vibranium_allthemodium_alloy_ingot', 3, 512000, 'mysticalagradditions:creative_essence', [
    'allthemodium:vibranium_ingot',
    'allthemodium:allthemodium_ingot'
  ])
  //MekaSuit
  event.remove({id: 'mekanism:mekasuit_helmet'})
  event.remove({id: 'mekanism:mekasuit_bodyarmor'})
  event.remove({id: 'mekanism:mekasuit_pants'})
  event.remove({id: 'mekanism:mekasuit_boots'})
  draconicFusion(event, 'mekanism:mekasuit_helmet', 4, 356000000000, 'allthemodium:unobtainium_helmet', [
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:ultimate_control_circuit',
    'mekanism:basic_induction_cell',
    'mekanism:pellet_polonium',
    'mekanism:pellet_polonium'
  ])

  draconicFusion(event, 'mekanism:mekasuit_bodyarmor', 4, 356000000000, 'allthemodium:unobtainium_chestplate', [
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:ultimate_control_circuit',
    'mekanism:basic_induction_cell',
    'mekanism:pellet_polonium',
    'mekanism:pellet_polonium'
  ])

  draconicFusion(event, 'mekanism:mekasuit_pants', 4, 356000000000, 'allthemodium:unobtainium_leggings', [
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:ultimate_control_circuit',
    'mekanism:basic_induction_cell',
    'mekanism:pellet_polonium',
    'mekanism:pellet_polonium'
  ])

  draconicFusion(event, 'mekanism:mekasuit_boots', 4, 356000000000, 'allthemodium:unobtainium_boots', [
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:hdpe_sheet',
    'mekanism:ultimate_control_circuit',
    'mekanism:basic_induction_cell',
    'mekanism:pellet_polonium',
    'mekanism:pellet_polonium'
  ])
  //Draconic Evolution
  draconicFusion(event, 'draconicevolution:creative_capacitor', 4, 356000000000, 'atmadditions:atm_star', [
    'draconicevolution:chaotic_capacitor',
    'draconicevolution:chaotic_capacitor',
    'draconicevolution:chaotic_capacitor',
    'draconicevolution:chaotic_capacitor',
    'draconicevolution:chaotic_core',
    'draconicevolution:chaotic_core',
    'draconicevolution:chaotic_core',
    'draconicevolution:chaotic_core'
  ])

  draconicFusion(event, 'draconicevolution:creative_op_capacitor', 4, 356000000000, 'draconicevolution:creative_capacitor', [
    'draconicevolution:chaotic_energy_module',
    'draconicevolution:chaotic_energy_module',
    'draconicevolution:chaotic_energy_module',
    'draconicevolution:chaotic_energy_module',
    'draconicevolution:chaotic_energy_core',
    'draconicevolution:chaotic_energy_core',
    'draconicevolution:chaotic_energy_core',
    'draconicevolution:chaotic_energy_core'
  ])
})