# RoomClient: private property

> The private read-only property of the RoomClient interface is the player's private state, which only this player sees.

The **`private`** read-only property of the [`RoomClient`](/docs/client/room-client) interface is the player's private state: the entity of the schema's `private` kind that the room keeps for this player and sends to no one else.

## Value

An [`OwnedEntity`](/docs/client/owned-entity) of the schema's `private` kind, or `undefined` until [`ready`](/docs/client/room-client/ready) resolves. On the client that [`connect()`](/docs/client/connect) and `ready` resolve to, it's typed as set.

### Exceptions

`TypeError`
: Thrown if a field that isn't in the kind's `writable` list is written.

## Description

The player owns its private state, so the client can set the fields the `private` kind declares `writable`. Each write changes the field at once and is sent to the room as an owner write, at most once per room tick; the room applies it at the tick, and its own value overwrites it if the room corrects it. [`flush()`](/docs/client/room-client/flush) sends the writes at once. The other fields are the room's, and change only with state updates.

Private state is entity 1, so [`entities.onChange()`](/docs/client/entity-store/onchange) with the schema's `private` kind runs when its fields change. The room reads and writes it with [`room.private()`](/docs/room/room/private).

## Examples

### Choosing a loadout

The room keeps each player's gold, and the player picks a loadout, the one field the room lets them write.

```ts
// loadout.ts
import { connect, defineSchema, entity } from "@irtio/client";

const Hero = entity("hero", { gold: "u32", loadout: "string" }, { writable: ["loadout"] });
const room = await connect("main", { schema: defineSchema({ private: Hero }) });

export function choose(loadout: "archer" | "knight") {
  room.private.loadout = loadout;
  console.log(`${loadout} chosen, ${room.private.gold} gold left`);
}
```

## See also

- [`RoomClient.state`](/docs/client/room-client/state)
- [`Room.private()`](/docs/room/room/private), the room's side
- [Ownership](/docs/room/guides/ownership)
