packet

This page will go over the Packet API namespace.

sendKeepAlive(key): Undefined

ArgumentTypeDescription

key

Number

The keepalive key.

Sends a C00 KeepAlive.

sendMessage(msg): Undefined

ArgumentTypeDescription

msg

String

The message to send.

Sends a C01 ChatMessage.

sendUseEntity(entity, action): Undefined

ArgumentTypeDescription

entity

Entity | Number

The entity.

action

string | Vec3

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

Sends a C02 UseEntity.

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

ArgumentTypeDescription

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

ArgumentTypeDescription

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

ArgumentTypeDescription

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

ArgumentTypeDescription

slot

Number

The new slot to switch to.

Sends a C09 HeldItemChange.

sendEntityAction(entityId, action): Undefined

ArgumentTypeDescription

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

ArgumentTypeDescription

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

ArgumentTypeDescription

id

Number

The window ID. This parameter is optional.

Sends a C0D CloseWindow.

sendEnchantItem(window, enchantment): Undefined

ArgumentTypeDescription

id

Number

The window ID. This parameter is optional.

enchantment

Number

The enchantment ID.

Sends a C11 EnchantItem.

sendTransaction(window, uid, accepted): Undefined

ArgumentTypeDescription

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

ArgumentTypeDescription

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

ArgumentTypeDescription

msg

string

The message.

pos

The position.

Sends a C14 TabComplete.

sendStatus(status): Undefined

ArgumentTypeDescription

status

string

The value of C16PacketClientStatus.EnumState

Sends a C16 ClientStatus.

sendSettings(): Undefined

Sends a C15 ClientSettings.

Last updated