EntityEvents.hurt(event => {
    var source = event.source.actual;
    var target = event.entity;

    // Ensure the source is an entity (not a block, projectile, etc.)
    if (!source || !source.isLiving() || !target || !target.isLiving()) return;

    palladium.abilities.getEntries(source, 'arrzenhanced:shock_punch').forEach(ability => {
        if (!ability.isEnabled()) return
        if (!event.source.type().msgId().includes('player')) return
        
        if (!target?.potionEffects) return
        target.potionEffects.add('arrzenhanced:shocked', 5 * 20, 0, false, false)
    })
})
