Class

Client

Client(Options)

Main Client class, containing high level functions to use. Use this to create your bot.
Constructor

# new Client(Options)

Parameters:
Name Type Description
Options ClientOptions

View Source client/Client.js, line 81

Extends

Methods

# changeTeam(TeamId)

Ask server to change team, server will send CreatePlayer with the new team.
Parameters:
Name Type Description
TeamId number Team ID to change.

View Source client/Client.js, line 309

# changeWeapon(WeaponId)

Ask server to change weapon
Parameters:
Name Type Description
WeaponId number Weapon ID to change.

View Source client/Client.js, line 322

# disconnect()

Disconnect the client from the server.

View Source client/Client.js, line 301

# getOnlinePlayers()

Get all players connected to the server

View Source client/Client.js, line 334

# hitPlayer(PlayerId, HitType)

Send an Hit packet to the server.
Parameters:
Name Type Description
PlayerId number The player's ID to get hitted.
HitType number Hit type.

View Source client/Client.js, line 289

# joinGame(JoinObject)

Join in a team, normally used after StateData packet.
Parameters:
Name Type Description
JoinObject JoinObject

View Source client/Client.js, line 94

# lookAt(x, y, z)

Look at a specific coordinate.
Parameters:
Name Type Description
x number
y number
z number

View Source client/Client.js, line 148

# placeBlock(X, Y, Z)

Try to place a block in a specific coordinate.
Parameters:
Name Type Description
X number X Coordinate
Y number Y Coordinate
Z number Z Coordinate

View Source client/Client.js, line 203

# sendCustomReload(Clip, Reserver)

Send a reload packet with custom clip ammo and reserve ammo.
Parameters:
Name Type Description
Clip number AMMO in the Clip
Reserver number AMMO in the Reserve

View Source client/Client.js, line 255

# sendLines(Messages, ChatType, Delay)

Send multiple messages a once with a delay between them.
Parameters:
Name Type Description
Messages array String array with the messages to be sent.
ChatType number Chat Type ID
Delay number Delay in ms between each message.

View Source client/Client.js, line 133

# sendMessage(Message, ChatType)

Send a message in the chat.
Parameters:
Name Type Description
Message string String representing the message text
ChatType number Chat type ID

View Source client/Client.js, line 117

# sendVersion()

Send to the server your client and version infos, remember to set version using setVersionInfo() before this.

View Source client/Client.js, line 373

# sendVersionHandshake(Challenge)

Response to an handshake sent by the server
Parameters:
Name Type Description
Challenge number The Challenge int sent by the server on VersionHandshakeInit

View Source client/Client.js, line 350

# setColor(Red, Green, Blue)

Set block color.
Parameters:
Name Type Description
Red number Red color amount
Green number Green color amount
Blue number Blue color amount

View Source client/Client.js, line 173

# setPosition(X, Y, Z)

Set Client's position.
Parameters:
Name Type Description
X number X Coordinate
Y number Y Coordinate
Z number Z Coordinate

View Source client/Client.js, line 240

# setTool(ToolId)

Set tool to hold.
Parameters:
Name Type Description
ToolId number Tool Id

View Source client/Client.js, line 188

# setVersionInfo(VersionObjectopt)

Set the version informations for the server.
Parameters:
Name Type Attributes Description
VersionObject VersionInfoObject <optional>
Object with the version informations.

View Source client/Client.js, line 362

# setWalkInputs(WalkInputs)

Set Client's inputs.
Parameters:
Name Type Description
WalkInputs WalkInputs

View Source client/Client.js, line 219

# toggleFiring() → {boolean}

Toggle/untoggle weapon firing.

View Source client/Client.js, line 269

boolean