---
title: Animate
description: "Play 0x02, server → client."
---

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

Tells the client to play a one-shot animation on an entity: swing main hand, swing off hand, leave bed, critical hit, or magic critical hit. The server sends it when an entity performs the action. The client plays the visual animation on the entity with the given `entityId`.

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

## Fields

| Field | Type | Notes |
|---|---|---|
| `entityId` | VarInt |  |
| `animation` | UByte |  |

## Send it

```ts
await client.sendPacket("Animate", {
  entityId: /* VarInt */,
  animation: /* UByte */,
});
```

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

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