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

    .input('4x minecraft:redstone_block')
    .input('4x minecraft:iron_nugget')
    .input('armageddon_mod:elvenite_ingot')

    .recipeTime(100)
})

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

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

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

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

  event.server.runCommandSilent(cmd)
})

