ServerEvents.recipes(event => {
  event.recipes.summoningrituals
    .altar('armageddon_mod:helionite_ingot')
    .id('kubejs:summoning/nyxaris')

    .input('4x armageddon_mod:elvenite_ingot')
    .input('16x minecraft:coal')
    .input('armageddon_mod:khyros_tear')
    .recipeTime(100)
    .dayTime('day')
})

SummoningRituals.complete(event => {
  const id = String(event.recipe.getId())

  if (id !== 'kubejs:summoning/nyxaris') return

  let cmd = 'summon armageddon_mod:nyxaris_the_veil_of_oblivion ~ ~ ~'

  if (event.pos) {
    cmd = `summon armageddon_mod:nyxaris_the_veil_of_oblivion ${event.pos.x} ${event.pos.y + 1} ${event.pos.z}`
  } else if (event.block) {
    cmd = `summon armageddon_mod:nyxaris_the_veil_of_oblivion ${event.block.x} ${event.block.y + 1} ${event.block.z}`
  }

  event.server.runCommandSilent(cmd)
})