C0CPacketInput

Packet sent by the client to update player movement input

Example

var packet = new C0CPacketInput(0, 1, true, false); // Create a packet for moving forward and jumping

Extends

Constructors

Constructor

new C0CPacketInput(strafe, forward, jumping, sneaking): C0CPacketInput

Creates a new C0CPacketInput with the specified movement values

Parameters

strafe

number

strafe - The strafe speed (-1.0 to 1.0)

forward

number

forward - The forward speed (-1.0 to 1.0)

jumping

boolean

jumping - Whether the player is jumping

sneaking

boolean

sneaking - Whether the player is sneaking

Returns

C0CPacketInput

Overrides

Packet.constructor

Methods

getForward()

getForward(): number

Gets the forward speed

Returns

number

The forward speed (-1.0 to 1.0)


getPacketID()

getPacketID(): string

Get the ID of the packet.

Returns

string

The ID of the packet.

Inherited from

Packet.getPacketID


getStrafe()

getStrafe(): number

Gets the strafe speed

Returns

number

The strafe speed (-1.0 to 1.0)


isJumping()

isJumping(): boolean

Checks if jumping is enabled

Returns

boolean

True if the player is jumping


isSneaking()

isSneaking(): boolean

Checks if sneaking is enabled

Returns

boolean

True if the player is sneaking


setForward()

setForward(forward): void

Sets the forward speed

Parameters

forward

number

forward - The new forward speed (-1.0 to 1.0)

Returns

void


setJumping()

setJumping(jumping): void

Sets the jumping state

Parameters

jumping

boolean

jumping - Whether jumping should be enabled

Returns

void


setSneaking()

setSneaking(sneaking): void

Sets the sneaking state

Parameters

sneaking

boolean

sneaking - Whether sneaking should be enabled

Returns

void


setStrafe()

setStrafe(strafe): void

Sets the strafe speed

Parameters

strafe

number

strafe - The new strafe speed (-1.0 to 1.0)

Returns

void

Last updated