---
title: Set Time
description: "Play 0x71, server → client."
---

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

Synchronizes world time. `gameTime` is the total world age in ticks; `clockUpdates` carries the day-time clock, whether it advances, and at what rate. The server sends it every 20 ticks so the client's sky and clocks stay in sync.

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

## Fields

| Field | Type | Notes |
|---|---|---|
| `gameTime` | Long |  |
| `clockUpdates` | Array |  |

## Send it

```ts
await client.sendPacket("SetTime", {
  gameTime: 0n,
  clockUpdates: [
    { clock: 0, totalTicks: 6000n, partialTick: 0, rate: 1 }, // 0 = day/night clock; 6000 = noon
  ],
});

// Freeze the sun at noon.
await client.sendPacket("SetTime", {
  gameTime: 0n,
  clockUpdates: [{ clock: 0, totalTicks: 6000n, partialTick: 0, rate: 0 }],
});
```

`gameTime` is the world's total tick count. Each `clockUpdates` entry sets one clock: `totalTicks` is its current value, `rate` how many ticks it advances per server tick on the client (`0` stops it). Clock `0` is the day/night cycle (`0` sunrise, `6000` noon, `12000` sunset, `18000` midnight). The vanilla server sends this every 20 ticks.

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

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