cClientHandle


Index:
Articles
Classes
Hooks

Quick navigation:
cArrowEntity
cBeaconEntity
cBedEntity
cBlockArea
cBlockEntity
cBlockEntityWithItems
cBlockInfo
cBoat
cBoundingBox
cBrewingstandEntity
cChatColor
cChestEntity
cChunkDesc
cClientHandle
cColor
cCommandBlockEntity
cCompositeChat
cCraftingGrid
cCraftingRecipe
cCryptoHash
cCuboid
cDispenserEntity
cDropperEntity
cDropSpenserEntity
cEnchantments
cEntity
cEntityEffect
cExpBottleEntity
cExpOrb
cFallingBlock
cFile
cFireChargeEntity
cFireworkEntity
cFloater
cFlowerPotEntity
cFurnaceEntity
cGhastFireballEntity
cHangingEntity
cHopperEntity
cIniFile
cInventory
cItem
cItemFrame
cItemGrid
cItems
cJson
cJukeboxEntity
cLeashKnot
cLineBlockTracer
cLuaWindow
cMap
cMapManager
cMobHeadEntity
cMobSpawnerEntity
cMojangAPI
cMonster
cNetwork
cNoteEntity
cObjective
cPainting
cPawn
cPickup
cPlayer
cPlugin
cPluginLua
cPluginManager
cProjectileEntity
cRankManager
cRoot
cScoreboard
cServer
cServerHandle
cSignEntity
cSplashPotionEntity
cStatManager
cStringCompression
cTCPLink
cTeam
cThrownEggEntity
cThrownEnderPearlEntity
cThrownSnowballEntity
cTNTEntity
cTracer
cUDPEndpoint
cUrlClient
cUrlParser
cWebAdmin
cWindow
cWitherSkullEntity
cWorld
EffectID
HTTPFormData
HTTPRequest
HTTPTemplateRequest
ItemCategory
lxp
SmokeDirection
sqlite3
TakeDamageInfo
tolua
Vector3d
Vector3f
Vector3i
Globals

Contents


cClientHandle class

A cClientHandle represents the technical aspect of a connected player - their game client connection. Internally, it handles all the incoming and outgoing packets, the chunks that are to be sent to the client, ping times etc.


Constants

NameValueNotes
MAX_VIEW_DISTANCE 32 The maximum value of the view distance
MIN_VIEW_DISTANCE 1 The minimum value of the view distance

Functions

NameParametersReturn valueNotes
GenerateOfflineUUID
Usernamestring
string
(STATIC) Generates an UUID based on the player name provided. This is used for the offline (non-auth) mode, when there's no UUID source. Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same. Returns a 32-char UUID (no dashes).
GetClientBrand
string
Returns the brand that the client has sent in their MC|Brand plugin message.
GetIPString
string
Returns the IP address of the connection, as a string. Only the address part is returned, without the port number.
GetLocale
Localestring
Returns the locale string that the client sends as part of the protocol handshake. Can be used to provide localized strings.
GetPing
number
Returns the ping time, in ms
GetPlayer
cPlayer
Returns the player object connected to this client. Note that this may be nil, for example if the player object is not yet spawned.
GetProtocolVersion
number
Returns the protocol version number of the protocol that the client is talking. Returns zero if the protocol version is not (yet) known.
GetRequestedViewDistance
number
Returns the view distance that the player request, not the used view distance.
GetUUID
string
Returns the authentication-based UUID of the client. This UUID should be used to identify the player when persisting any player-related data. Returns a 32-char UUID (no dashes)
GetUniqueID
number
Returns the UniqueID of the client used to identify the client in the server
GetUsername
string
Returns the username that the client has provided
GetViewDistance
number
Returns the viewdistance (number of chunks loaded for the player in each direction)
HasPluginChannel
ChannelNamestring
boolean
Returns true if the client has registered to receive messages on the specified plugin channel.
IsUUIDOnline
UUIDstring
boolean
(STATIC) Returns true if the UUID is generated by online auth, false if it is an offline-generated UUID. We use Version-3 UUIDs for offline UUIDs, online UUIDs are Version-4, thus we can tell them apart. Accepts both 32-char and 36-char UUIDs (with and without dashes). If the string given is not a valid UUID, returns false.
Kick
Reasonstring
Kicks the user with the specified reason
SendBlockChange
BlockXnumber
BlockYnumber
BlockZnumber
BlockTypenumber
BlockMetanumber
Sends a BlockChange packet to the client. This can be used to create fake blocks only for that player.
SendEntityAnimation
EntitycEntity
AnimationNumbernumber
Sends the specified animation of the specified entity to the client. The AnimationNumber is protocol-specific.
SendHideTitle Hides the title. This makes the title and subtitle disappear, but if you call SendTitleTimes() the same title and subtitle will appear again.
SendPluginMessage
Channelstring
Messagestring
Sends the plugin message on the specified channel.
SendResetTitle Resets and hides the title but not the subtitle.
SendSetRawSubTitle
SubTitlestring
Sends the raw subtitle to the client. Doesn't make the client display it yet, use SendTitleTimes() to show both the title and the subtitle.
SendSetRawTitle
Titlestring
Sends the raw title to the client. Doesn't make the client display it yet, use SendTitleTimes() to show both the title and the subtitle.
SendSetSubTitle
SubTitlecCompositeChat
Sends the subtitle to the client. Doesn't make the client display it yet, use SendTitleTimes() to show both the title and the subtitle.
SendSetTitle
TitlecCompositeChat
Sends the title to the client. Doesn't make the client display it yet, use SendTitleTimes() to show both the title and the subtitle.
SendSoundEffect
SoundNamestring
Xnumber
Ynumber
Znumber
Volumenumber
Pitchnumber
Sends a sound effect request to the client. The sound is played at the specified coords, with the specified volume (a float, 1.0 is full volume, can be more) and pitch (0-255, 63 is 100%)
SendTimeUpdate
WorldAgenumber
TimeOfDaynumber
DoDaylightCycleboolean
Sends the specified time update to the client. WorldAge is the total age of the world, in ticks. TimeOfDay is the current day's time, in ticks (0 - 24000). DoDaylightCycle is a bool that specifies whether the client should automatically move the sun (true) or keep it in the same place (false).
SendTitleTimes
FadeInTicksnumber
DisplayTicksnumber
FadeOutTicksnumber
Sends the request to display the title and subtitle, previously set with SendSetTitle, SendSetRawTitle, SendSetSubTitle and SendSetRawSubTitle, to the client.
SetClientBrand
ClientBrandstring
Sets the value of the client's brand. Normally this value is received from the client by a MC|Brand plugin message, this function lets plugins overwrite the value.
SetLocale
Localestring
Sets the locale that Cuberite keeps on record. Initially the locale is initialized in protocol handshake, this function allows plugins to override the stored value (but only server-side and only until the user disconnects).
SetUsername
Namestring
Sets the username
SetViewDistance
ViewDistancenumber
Sets the viewdistance (number of chunks loaded for the player in each direction)
Generated by APIDump on 2017-08-21 21:02:35, Build ID Unknown, Commit approx: e44a0adfcf623b37ee26f79e607f81dc16fac75e