# C02PacketUseEntity

A packet sent by the client to interact with entities.

### Extends

* [`Packet`](https://scripting.breeze.rip/api/net/minecraft/network/packet)

### Constructors

#### Constructor

> **new C02PacketUseEntity**(`wrapper`, `action`, `at`): `C02PacketUseEntity`

Creates a new C02PacketUseEntity packet

**Parameters**

**wrapper**

[`Entity`](https://scripting.breeze.rip/api/net/minecraft/entity/entity)

The entity to interact with

**action**

[`UseEntityAction`](https://scripting.breeze.rip/api/enum_types/useentityaction)

The action to perform (INTERACT, ATTACK or INTERACT\_AT)

**at**

[`Vec3`](https://scripting.breeze.rip/api/net/minecraft/util/vec3)

The hit vector for the interaction.

**Returns**

`C02PacketUseEntity`

**Overrides**

`Packet.constructor`

### Methods

#### getAction()

> **getAction**(): [`UseEntityAction`](https://scripting.breeze.rip/api/enum_types/useentityaction)

Gets the action performed on the entity

**Returns**

[`UseEntityAction`](https://scripting.breeze.rip/api/enum_types/useentityaction)

The action as a string (INTERACT, ATTACK or INTERACT\_AT)

***

#### getEntity()

> **getEntity**(): [`Entity`](https://scripting.breeze.rip/api/net/minecraft/entity/entity)

Gets the entity this packet is interacting with

**Returns**

[`Entity`](https://scripting.breeze.rip/api/net/minecraft/entity/entity)

The target entity

***

#### getHitVec()

> **getHitVec**(): [`Vec3`](https://scripting.breeze.rip/api/net/minecraft/util/vec3)

Gets the hit vector for INTERACT\_AT actions

**Returns**

[`Vec3`](https://scripting.breeze.rip/api/net/minecraft/util/vec3)

The hit vector or null if the action is not INTERACT\_AT

***

#### getPacketID()

> **getPacketID**(): `string`

Get the ID of the packet.

**Returns**

`string`

The ID of the packet.

**Inherited from**

[`Packet`](https://scripting.breeze.rip/api/net/minecraft/network/packet).[`getPacketID`](https://scripting.breeze.rip/api/net/minecraft/packet#getpacketid)

***

#### setAction()

> **setAction**(`action`): `void`

Sets the action to perform on the entity

**Parameters**

**action**

`string`

The new action (INTERACT, ATTACK or INTERACT\_AT)

**Returns**

`void`

***

#### setEntity()

> **setEntity**(`entity`): `void`

Sets the entity this packet is interacting with

**Parameters**

**entity**

[`Entity`](https://scripting.breeze.rip/api/net/minecraft/entity/entity)

The new target entity

**Returns**

`void`

***

#### setHitVec()

> **setHitVec**(`vec`): `void`

Sets the hit vector for INTERACT\_AT actions

**Parameters**

**vec**

[`Vec3`](https://scripting.breeze.rip/api/net/minecraft/util/vec3)

The new hit vector

**Returns**

`void`
