C0CPacketInput
Last updated
Packet sent by the client to update player movement input
var packet = new C0CPacketInput(0, 1, true, false); // Create a packet for moving forward and jumpingnew C0CPacketInput(
strafe,forward,jumping,sneaking):C0CPacketInput
Creates a new C0CPacketInput with the specified movement values
Parameters
strafe
number
The strafe speed (-1.0 to 1.0)
forward
number
The forward speed (-1.0 to 1.0)
jumping
boolean
Whether the player is jumping
sneaking
boolean
Whether the player is sneaking
Returns
C0CPacketInput
Overrides
Packet.constructor
getForward():
number
Gets the forward speed
Returns
number
The forward speed (-1.0 to 1.0)
getPacketID():
string
Get the ID of the packet.
Returns
string
The ID of the packet.
Inherited from
getStrafe():
number
Gets the strafe speed
Returns
number
The strafe speed (-1.0 to 1.0)
isJumping():
boolean
Checks if jumping is enabled
Returns
boolean
True if the player is jumping
isSneaking():
boolean
Checks if sneaking is enabled
Returns
boolean
True if the player is sneaking
setForward(
forward):void
Sets the forward speed
Parameters
forward
number
The new forward speed (-1.0 to 1.0)
Returns
void
setJumping(
jumping):void
Sets the jumping state
Parameters
jumping
boolean
Whether jumping should be enabled
Returns
void
setSneaking(
sneaking):void
Sets the sneaking state
Parameters
sneaking
boolean
Whether sneaking should be enabled
Returns
void
setStrafe(
strafe):void
Sets the strafe speed
Parameters
strafe
number
The new strafe speed (-1.0 to 1.0)
Returns
void
Last updated