ServerEvents.recipes(event => {
  event.recipes.summoningrituals
    .altar('armageddon_mod:elvenite_ingot')
    .id('kubejs:summoning/elvenite')
    
    .input('4x armageddon_mod:khyros_tear')
    .input('4x armageddon_mod:gilded_plate')
    .input('armageddon_mod:ancient_blueprint')

    .recipeTime(100)
})

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

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

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

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

  event.server.runCommandSilent(cmd)
})
