ServerEvents.recipes(event => {
let draconicFusion = (e, 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(':', '/')}`)
  }
draconicFusion(event, 'inclusiveutils:nanocube', 1, 31315926535, 'allthemodium:allthemodium_ingot', [
    'minecraft:dragon_egg',
    'minecraft:dragon_egg',
    'forbidden_arcanus:dark_nether_star',
    'draconicevolution:chaotic_core',
    'draconicevolution:chaotic_core',
    'mekanism:pellet_plutonium',
    'mekanism:pellet_polonium',
    'mysticalagradditions:insanium_ingot_block',
    'mysticalagradditions:insanium_ingot_block',
    'mysticalagradditions:gaia_spirit_crux'
  ])
})