---
title: Set Camera
description: "Play 0x5D, server → client."
---

`play` · `0x5D` · **clientbound** (server → client)

Sets the entity the client's camera follows. The server sends it in spectator mode when the player starts or stops spectating an entity. The client renders from that entity's point of view until it receives its own entity ID again.

Sent by the server, read by the client. Listen for it with `client.on("SetCamera", (data) => …)` on the receiving side.

## Fields

| Field | Type | Notes |
|---|---|---|
| `cameraId` | VarInt |  |

## Send it

```ts
await client.sendPacket("SetCamera", {
  cameraId: /* VarInt */,
});
```

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: [`src/Core/Versions/776/Packets/play/clientbound/SetCamera.ts`](https://github.com/GDLev/mc-protocol/blob/master/src/Core/Versions/776/Packets/play/clientbound/SetCamera.ts)
