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

    .input('4x minecraft:copper_ingot')
    .input('16x minecraft:cobbled_deepslate')
    .input('minecraft:raw_gold')

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

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

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

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

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

  event.server.runCommandSilent(cmd)
})

