# Entities: all() method

> The all() method of the Entities interface returns an iterator over every entity of a kind.

The **`all()`** method of the [`Entities`](/docs/room/entities) interface returns an iterator over every entity of a kind.

## Syntax

```ts
all(kind)
```

### Parameters

`kind`
: The kind of entities to visit.

### Return value

An iterator of [`RoomEntity`](/docs/room/room-entity) objects of `kind`, typed as that kind. For the shared state kind it yields `room.state`. It yields nothing for a kind with no entities.

## Description

`all()` visits every entity of the kind on each call. In a stepper, which runs every tick, loop with it over the few kinds that move, and reach everything else by ID or key with [`get()`](/docs/room/entities/get).

## Examples

### Regrowing trees over time

```ts
// forest.ts
import { defineRoom, defineSchema, entity } from "@irtio/room";

const Tree = entity("tree", { x: "f32", y: "f32", wood: "u8" });

export default defineRoom({
  tickRate: 1,
  schema: defineSchema({ entities: [Tree] }),
  onTick(room) {
    for (const tree of room.entities.all(Tree)) {
      if (tree.wood < 10) tree.wood += 1;
    }
  },
});
```

## See also

- [`Entities.get()`](/docs/room/entities/get)
- [`Entities.count`](/docs/room/entities/count)
