new entity = -1; while ((entity = FindEntityByClassName(entity, "chicken")) > 0) { // Do something with entity }