Skip to content
mc-protocol
Esc
↑↓navigate↵open⌘Jpreview
On this page

Hurt Animation

Play 0x2A, server → client.

play · 0x2A · clientbound (server → client)

Plays the hurt animation on the entity entityId, with yaw giving the direction of the damage source. The server sends it when a tracked entity is hit. The client tilts the camera or flashes the entity red toward that direction.

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

Fields

Field Type Notes
entityId VarInt
yaw Float also hurtAnimation

Send it

await client.sendPacket("HurtAnimation", {
  entityId: /* VarInt */,
  yaw: /* Float */,
});

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

Source: src/Core/Versions/776/Packets/play/clientbound/HurtAnimation.ts

Was this page helpful?