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

    .input('minecraft:egg')
    .input('16x minecraft:nether_wart')
    .input('armageddon_mod:calamitous_core')

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

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

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

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

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

  event.server.runCommandSilent(cmd)
})