EntityEvents.hurt("minecraft:player",event => {
    if (event.entity.isPlayer() && abilityUtil.hasPower(event.player, 'arrzenhanced:nether_star_core')) {
        let entity = event.entity;
        let damage = event.damage;
        let entry = event.entity.entry;
        let server = event.server;
        let health = entity.health;
        let username = entity.getGameProfile().getName();
        if (damage >= health) {
            server.runCommandSilent(`execute as ${username} at @s run function arrzenhanced:cosmic_enhancement/obtain`);
            entity.health = 1
            event.cancel()
        }
    }
})