ServerEvents.recipes(event => {
  event.recipes.summoningrituals
    .altar('minecraft:sunflower')
    .id('kubejs:summoning/newborn')

    .input('4x armageddon_mod:hemalith_catalyst')
    .input('16x minecraft:netherrack')
    .input('armageddon_mod:bloody_ingot')

    .recipeTime(100)
    .dayTime('day')
})

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

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

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

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

  event.server.runCommandSilent(cmd)
})