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.
Name | Parameters | Return value | Notes |
GenerateOfflineUUID |
|
|
(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 |
|
|
Returns the brand that the client has sent in their MC|Brand plugin message. |
GetForgeMods |
|
|
Returns the Forge mods installed on the client. |
GetIPString |
|
|
Returns the IP address of the connection, as a string. Only the address part is returned, without the port number. |
GetLocale |
|
|
Returns the locale string that the client sends as part of the protocol handshake. Can be used to provide localized strings. |
GetPing |
|
|
Returns the ping time, in ms |
GetPlayer |
|
|
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 |
|
|
Returns the protocol version number of the protocol that the client is talking. Returns zero if the protocol version is not (yet) known. |
GetRequestedViewDistance |
|
|
Returns the view distance that the player request, not the used view distance. |
GetUUID |
|
|
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 |
|
|
Returns the UniqueID of the client used to identify the client in the server |
GetUsername |
|
|
Returns the username that the client has provided |
GetViewDistance |
|
|
Returns the viewdistance (number of chunks loaded for the player in each direction) |
HasPluginChannel |
|
|
Returns true if the client has registered to receive messages on the specified plugin channel. |
IsForgeClient |
|
|
Returns true if the client is modded with Forge. |
IsUUIDOnline |
|
|
(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 |
|
|
Kicks the user with the specified reason |
SendBlockBreakAnim |
EntityID | number | BlockX | number | BlockY | number | BlockZ | number | Stage | number |
|
|
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 |
BlockX | number | BlockY | number | BlockZ | number | BlockType | number | BlockMeta | number |
|
|
Sends a BlockChange packet to the client. This can be used to create fake blocks only for that player. |
SendBossBarAdd |
|
|
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 |
|
|
Removes the boss bar with the given ID from the client's UI. |
SendBossBarUpdateFlags |
UniqueID | number | DarkenSky | boolean | PlayEndMusic | boolean | CreateFog | boolean |
|
|
Updates a boss bar on the client's UI. Only updates some meta flags for additional effects. |
SendBossBarUpdateHealth |
UniqueID | number | FractionFilled | number |
|
|
Updates the health displayed by the boss bar with the given ID. |
SendBossBarUpdateStyle |
|
|
Updates a boss bar on the client's UI. Only updates the visuals of the Boss Bar. |
SendBossBarUpdateTitle |
|
|
Updates a boss bar on the client's UI. Only Updates the text at the top. |
SendCollectEntity |
|
|
Sends the CollectEntity packet to the client. This fakes item collecting. |
SendDestroyEntity |
|
|
Sends the DestroyEntity packet to the client. This tells the client to remove the entity from the world. |
SendDetachEntity |
|
|
Sends the DetachEntity packet to the client. This drop entities riding another one (boat, minecarts, pigs, horses...). |
SendEditSign |
BlockX | number | BlockY | number | BlockZ | number |
|
|
Sends the EditSign packet to the client. This opens the sign editor GUI. |
SendEntityAnimation |
|
|
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 |
|
|
Sends the LeashEntity packet to the client. Leashes entities together. Leashing to the player, the leash will appear on the player's hand |
|
|
(undocumented) |
SendPluginMessage |
Channel | string | Message | string |
|
|
Sends the plugin message on the specified channel. |
SendResetTitle |
|
|
Resets and hides the title but not the subtitle. |
SendResourcePack |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
SoundName | string | X | number | Y | number | Z | number | Volume | number | Pitch | number |
|
|
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 |
BlockX | number | BlockY | number | BlockZ | number |
|
|
Sends the thunderbolt at the specified coords to the client. The client will display the effect without any sound. |
SendTimeUpdate |
WorldAge | number | WorldDate | number | DoDaylightCycle | boolean |
|
|
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 |
FadeInTicks | number | DisplayTicks | number | FadeOutTicks | number |
|
|
Sends the request to display the title and subtitle, previously set with SendSetTitle, SendSetRawTitle, SendSetSubTitle and SendSetRawSubTitle, to the client. |
SendUnleashEntity |
|
|
Sends the UnleashEntity packet to the client. The client will remove any leashes related to the entity. |
SetClientBrand |
|
|
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 |
|
|
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 |
|
|
Sets the viewdistance (number of chunks loaded for the player in each direction) |