cClientHandle


Index:
Articles
Classes
Hooks

Quick navigation:
BannerPattern
BossBarColor
BossBarDivisionType
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
cEnderCrystal
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
cStringCompression
cTCPLink
cTeam
cThrownEggEntity
cThrownEnderPearlEntity
cThrownSnowballEntity
cTNTEntity
cUDPEndpoint
cUrlClient
cUrlParser
CustomStatistic
cUUID
cWebAdmin
cWindow
cWitherSkullEntity
cWorld
EffectID
HTTPFormData
HTTPRequest
HTTPTemplateRequest
ItemCategory
lxp
SmokeDirection
sqlite3
StatisticsManager
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.
GetForgeMods
table
Returns the Forge mods installed on the client.
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.
IsForgeClient
boolean
Returns true if the client is modded with Forge.
IsUUIDOnline
UUIDcUUID
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).
Kick
Reasonstring
Kicks the user with the specified reason
SendBlockBreakAnim
EntityIDnumber
BlockXnumber
BlockYnumber
BlockZnumber
Stagenumber
Sends a BlockBreakAnim packet to the client. Only one block can be broken at a time with the same UUID (the other will be reset). You can counter this using random values. The breaking stage ranges between 0 (first stage) and 9 (almost destroyed). Use -1 to reset the destruction.
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.
SendBossBarAdd
UniqueIDnumber
TitlecCompositeChat
FractionFillednumber
ColourBossBarColor
DivisionTypeBossBarDivisionType
DarkenSkyboolean
PlayEndMusicboolean
CreateFogboolean
Creates a boss bar on the client's UI. The boss bar is independent of any entity and has a lifetime and properties fully controlled by the plugin. Plugins are responsible for assigning a unique ID and removal.
SendBossBarRemove
UniqueIDnumber
Removes the boss bar with the given ID from the client's UI.
SendBossBarUpdateFlags
UniqueIDnumber
DarkenSkyboolean
PlayEndMusicboolean
CreateFogboolean
Updates a boss bar on the client's UI. Only updates some meta flags for additional effects.
SendBossBarUpdateHealth
UniqueIDnumber
FractionFillednumber
Updates the health displayed by the boss bar with the given ID.
SendBossBarUpdateStyle
UniqueIDnumber
ColorBossBarColor
DivisionTypeBossBarDivisionType
Updates a boss bar on the client's UI. Only updates the visuals of the Boss Bar.
SendBossBarUpdateTitle
UniqueIDnumber
TitlecCompositeChat
Updates a boss bar on the client's UI. Only Updates the text at the top.
SendCollectEntity
EntitycEntity
CollectorcEntity
Sends the CollectEntity packet to the client. This fakes item collecting.
SendDestroyEntity
EntitycEntity
Sends the DestroyEntity packet to the client. This tells the client to remove the entity from the world.
SendDetachEntity
EntitycEntity
Sends the DetachEntity packet to the client. This drop entities riding another one (boat, minecarts, pigs, horses...).
SendEditSign
BlockXnumber
BlockYnumber
BlockZnumber
Sends the EditSign packet to the client. This opens the sign editor GUI.
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.
SendLeashEntity
EntitycEntity
EntityLeashedTocEntity
Sends the LeashEntity packet to the client. Leashes entities together. Leashing to the player, the leash will appear on the player's hand
SendPlayerListHeaderFooter
HeadercCompositeChat
FootercCompositeChat
(undocumented)
SendPluginMessage
Channelstring
Messagestring
Sends the plugin message on the specified channel.
SendResetTitle Resets and hides the title but not the subtitle.
SendResourcePack
ResourcePackURLstring
Sends the ResourcePack packet to the client. The client will request the resource pack from the given URL. If the url is blank, the resource pack will be reset.
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%) (DEPRECATED, use vector-parametered version instead)
SendThunderbolt
BlockXnumber
BlockYnumber
BlockZnumber
Sends the thunderbolt at the specified coords to the client. The client will display the effect without any sound.
SendTimeUpdate
WorldAgenumber
WorldDatenumber
DoDaylightCycleboolean
Sends the specified time update to the client. WorldAge is the total age of the world, in ticks. WorldDate is the current date, in ticks, and is used by the client to calculate the days elapsed (F3 debug overlay's day count) and the time of day (rendered sun position). 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.
SendUnleashEntity
EntityIDnumber
Sends the UnleashEntity packet to the client. The client will remove any leashes related to the entity.
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).
SetViewDistance
ViewDistancenumber
Sets the viewdistance (number of chunks loaded for the player in each direction)
Generated by APIDump on 2024-11-15 00:45:52, Build ID 68, Commit c0f6c97dcea08feb7d5cd1deefc0f6f76eb2cdbd