---
title: Lock Difficulty
description: "Play 0x1D, client → server."
---

`play` · `0x1D` · **serverbound** (client → server)

Locks or unlocks the world difficulty from the options screen. `locked` is the new state. The server applies it only for operators in singleplayer or LAN worlds; on dedicated servers it is ignored.

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

## Fields

| Field | Type | Notes |
|---|---|---|
| `locked` | Boolean |  |

## Send it

```ts
await client.sendPacket("LockDifficulty", {
  locked: /* Boolean */,
});
```

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

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