---
title: Chat Command
description: "Play 0x07, client → server."
---

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

Executes a command typed by the player. `command` is the text without the leading slash. This form carries no signatures and is used for commands without signed string arguments. The server parses and runs the command with the player as source.

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

## Fields

| Field | Type | Notes |
|---|---|---|
| `command` | String |  |

## Send it

```ts
// Client side: run /spawn.
await client.sendPacket("ChatCommand", { command: "spawn" });
```

`command` has no leading slash. Use this for commands without signed arguments; the vanilla client uses `ChatCommandSigned` when an argument needs a signature. On the server, listen with `client.on("ChatCommand", …)`.

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

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