> For the complete documentation index, see [llms.txt](https://scripting.breeze.rip/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scripting.breeze.rip/newgen/api/net/minecraft/network/protocol/game/serverboundspectatoractionpacket.md).

# ServerboundSpectatorActionPacket

A spectator action: teleport to an entity, or leave the spectated entity. Only exists on 26.2 and later. **Since 26.2.**

### Extends

* [`Packet`](/newgen/api/net/minecraft/network/protocol/packet.md)

### Constructors

#### Constructor

> **new ServerboundSpectatorActionPacket**(`spectateEntityId`): `ServerboundSpectatorActionPacket`

A spectate action.

**Parameters**

**spectateEntityId**

`number`

The entity id, or -1 to stop spectating.

**Returns**

`ServerboundSpectatorActionPacket`

**Overrides**

`Packet.constructor`

### Properties

#### entity

> `readonly` **entity**: [`Entity`](/newgen/api/net/minecraft/world/entity/entity.md)

The entity to spectate, or null when none or not loaded.

***

#### id

> `readonly` **id**: `string`

The protocol id, e.g. "minecraft:swing". Stable across versions, unlike class names.

**Inherited from**

[`Packet`](/newgen/api/net/minecraft/network/protocol/packet.md).[`id`](/newgen/api/net/minecraft/network/protocol/packet.md#id)

***

#### name

> `readonly` **name**: `string`

The class name, e.g. "ServerboundSwingPacket".

**Inherited from**

[`Packet`](/newgen/api/net/minecraft/network/protocol/packet.md).[`name`](/newgen/api/net/minecraft/network/protocol/packet.md#name)

***

#### serverbound

> `readonly` **serverbound**: `boolean`

True for packets the client sends, false for ones it receives.

**Inherited from**

[`Packet`](/newgen/api/net/minecraft/network/protocol/packet.md).[`serverbound`](/newgen/api/net/minecraft/network/protocol/packet.md#serverbound)

***

#### spectateEntityId

> `readonly` **spectateEntityId**: `number`

The entity to spectate, or -1 when none.
