C02PacketUseEntity

A packet sent by the client to interact with entities.

Extends

Constructors

Constructor

new C02PacketUseEntity(wrapper, action, at): C02PacketUseEntity

Creates a new C02PacketUseEntity packet

Parameters

wrapper

Entity

entity - The entity to interact with

action

UseEntityAction

action - The action to perform (INTERACT, ATTACK or INTERACT_AT)

at

Vec3

at - The hit vector for the interaction.

Returns

C02PacketUseEntity

Overrides

Packet.constructor

Methods

getAction()

getAction(): UseEntityAction

Gets the action performed on the entity

Returns

UseEntityAction

The action as a string (INTERACT, ATTACK or INTERACT_AT)


getEntity()

getEntity(): Entity

Gets the entity this packet is interacting with

Returns

Entity

The target entity


getHitVec()

getHitVec(): Vec3

Gets the hit vector for INTERACT_AT actions

Returns

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.getPacketID


setAction()

setAction(action): void

Sets the action to perform on the entity

Parameters

action

string

action - 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

entity - The new target entity

Returns

void


setHitVec()

setHitVec(vec): void

Sets the hit vector for INTERACT_AT actions

Parameters

vec

Vec3

vec - The new hit vector

Returns

void

Last updated