for(var i = 0; i < spawnedEntities.length; i++) {
    var ent = spawnedEntities[i];
    if(ent.isAlive()) {
        if (!ent.getImmuneToFire()) {
            ent.setImmuneToFire(true);
        }
        ent.setFireLevel(1);
        var target = ent.getEntitiesWithinRange(2);
        for(var j = 0; j < target.length; j++) {
            var entj = target[j];
            if (entj.getClassType() == "Player") {
                player.setFireLevel(100)
}   }   }   }