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

    .input('4x minecraft:quartz')
    .input('16x minecraft:netherrack')
    .input('minecraft:lava_bucket')

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

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

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

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

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

  event.server.runCommandSilent(cmd)
})
