packet

This page will go over the Packet API namespace.

sendKeepAlive(key): Undefined

Argument
Type
Description

key

Number

The keepalive key.

Sends a C00 KeepAlive.

sendMessage(msg): Undefined

Argument
Type
Description

msg

String

The message to send.

Sends a C01 ChatMessage.

sendUseEntity(entity, action): Undefined

Argument
Type
Description

entity

The entity.

action

The value of C02PacketUseEntity.Action enum if string, hitvec otherwise.

Sends a C02 UseEntity.

sendPosition(x, y, z, yaw, pitch, ground): Undefined

Argument
Type
Description

x?

Number

X position. Must be present alongside Y and Z parameters.

y?

Number

Y position. Must be present alongside X and Z parameters.

z?

Number

Z position. Must be present alongside X and Y parameters.

yaw?

Number

Yaw angle rotation. Must be present alongside X, Y, Z and Pitch parameters.

pitch?

Number

Pitch angle rotation. Must be present alongside X, Y, Z and Yaw parameters.

ground

Boolean

Whether the player is on ground. Required parameter

Sends a C03/C04/C06 Packet. The following method overloads exist: sendPosition(x, y, z, ground); sendPosition(x, y, z, yaw, pitch, ground); sendPosition(ground)

sendDigging(enumStatus, pos, enumFacing): Undefined

Argument
Type
Description

enumStatus

string

The C07PacketPlayerDigging.Action enum.

pos

Block position.

enumFacing

string

The EnumFacing enum value

Sends a C07 PlayerDigging.

sendPlacement(pos, direction, x, y, z): Undefined

Argument
Type
Description

pos

The placement position.

direction

Number

The EnumFacing index.

x

Number

Facing X.

y

Number

Facing Y.

z

Number

Facing Z.

Sends a C08 PlayerBlockPlacement.

sendChangeItem(slot): Undefined

Argument
Type
Description

slot

Number

The new slot to switch to.

Sends a C09 HeldItemChange.

sendEntityAction(entityId, action): Undefined

Argument
Type
Description

entityId

Number

The ID of an entity.

action

string

The value of C0BPacketEntityAction.Action enum.

Sends a C0B EntityAction.

sendInput(strafeSpeed, forwardSpeed, jumping, sneaking): Undefined

Argument
Type
Description

strafeSpeed

Number

The player's strafe speed.

forwardSpeed

Number

The player's forward speed.

jumping

Boolean

Whether the player is jumping.

sneaking

Boolean

Whether the player is sneaking.

Sends a C0C Input.

sendCloseWindow(id): Undefined

Argument
Type
Description

id

Number

The window ID. This parameter is optional.

Sends a C0D CloseWindow.

sendEnchantItem(window, enchantment): Undefined

Argument
Type
Description

id

Number

The window ID. This parameter is optional.

enchantment

Number

The enchantment ID.

Sends a C11 EnchantItem.

sendTransaction(window, uid, accepted): Undefined

Argument
Type
Description

window

Number

The window ID.

uid

Number

The transaction ID.

accepted

Boolean

The transaction's accepted field.

Sends a C0F ConfirmTransaction.

sendAbilities(flying, allowFlying, creativeMode): Undefined

Argument
Type
Description

flying

Boolean

Whether the player is flying. This parameter is optional.

allowFlying

Boolean

Whether the player can be flying. This parameter is optional.

creativeMode

Boolean

Whether the player is in creative. This parameter is optional.

Sends a C13 PlayerAbilities. With no parameters supplied, this will send the player's current abilities.

sendTabComplete(msg, pos): Undefined

Argument
Type
Description

msg

string

The message.

pos

The position.

Sends a C14 TabComplete.

sendStatus(status): Undefined

Argument
Type
Description

status

string

The value of C16PacketClientStatus.EnumState

Sends a C16 ClientStatus.

sendSettings(): Undefined

Sends a C15 ClientSettings.

Last updated