
// made by blueversal

ServerEvents.recipes(event => {
    event.shaped('eeeabsmobs:netherworld_katana', [
      '   ',
      'xEe',
      '   '
    ], {
      x: 'eeeabsmobs:immortal_bone',  
      E: 'eeeabsmobs:ancient_drive_crystal',
      e: 'eeeabsmobs:ghost_steel_ingot'      
    });
  });

EntityEvents.death(event => {
  const entity = event.entity
  if (entity.type !== 'eeeabsmobs:realm_warden') return
  const server = event.server
  const x = entity.x
  const y = entity.y + 2
  const z = entity.z
  server.runCommandSilent(
    `playsound minecraft:entity.generic.explode master @a[x=${x},y=${y},z=${z},distance=..50] ${x} ${y} ${z} 1 1`
  )
  server.runCommandSilent(
    `effect give @a[x=${x},y=${y},z=${z},distance=..50] minecraft:blindness 5 0 true`
  )
  server.scheduleInTicks(20, () => {
    server.runCommandSilent(
      `summon eeeabsmobs:nameless_guardian ${x} ${y} ${z}`
    )
  })
})