# Replay: entities property

> The entities read-only property of the Replay interface is an EntityStore holding the replay's entities at the tick shown.

The **`entities`** read-only property of the [`Replay`](/docs/client/replay) interface holds the replay's entities at the tick shown, with the same events as a live room's.

## Value

An [`EntityStore`](/docs/client/entity-store).

## Description

A replay records every entity a client that sees everything would have seen. Its store's callbacks fire as a live client's do: [`play()`](/docs/client/replay/play) and [`step()`](/docs/client/replay/step) fire each tick's leaves, enters and changes, and [`seek()`](/docs/client/replay/seek) makes the entities shown leave and those at the new tick enter, without the changes between. So the code that renders a live room renders a replay when given this store instead of `room.entities`.

The entities are read-only.

## Examples

### Rendering a replay with the live game's code

A game's renderer takes an `EntityStore`, so the live game passes `room.entities` and the replay viewer passes `replay.entities`.

```ts
// render-goals.ts
import { defineSchema, entity, type EntityStore } from "@irtio/client";
import { loadReplay } from "@irtio/client/replay";

const Ball = entity("ball", { x: "f32", y: "f32" });
export const schema = defineSchema({ entities: [Ball] });

export function renderBalls(entities: EntityStore): void {
  entities.onEnter(Ball, (b) => console.log(`ball ${b.id} appears`));
  entities.onChange(Ball, (b) => console.log(`ball ${b.id} at ${b.x}, ${b.y}`));
  entities.onLeave(Ball, (b) => console.log(`ball ${b.id} gone`));
}

export function watch(bytes: Uint8Array): void {
  const replay = loadReplay(bytes, { schema });
  renderBalls(replay.entities);
  replay.play();
}
```

## See also

- [`EntityStore`](/docs/client/entity-store)
- [`Replay.state`](/docs/client/replay/state)
- [Playing back](/docs/room/guides/replays#playing-back) in Replays and clips
