for (var i = 0; i < spawnedEntities.length; i++) {
    var ent = spawnedEntities[i];
        ent.setImmuneToFire(true);
        ent.health = 20
        ent.heldItem = Item(267);
        ent.setTarget(player)
        }