// priority: 0

// Visit the wiki for more info - https://kubejs.com/

// made by blueversal

EntityEvents.hurt(event => {
    const target = event.entity
    const source = event.source
    const attacker = source.actual
    if (target.type !== 'goety:apostle')
        return
    if (!attacker)
        return
    if (!attacker.isPlayer())
        return
    const weapon = attacker.mainHandItem
    if (weapon.id !== 'lethality:nightmare_sword')
        return
    const damage = event.amount
    event.cancel()
    target.attack(damage)
})