network
This page will go over the networking API namespace.
Last updated
This page will go over the networking API namespace.
Last updated
This API is deprecated due to unstable implementation. Consider using instead.
sendPacket(id, ...parameters): Undefined
receivePacket(id, ...parameters): Undefined
id
Number
Packet ID.
0x03 -> C03, 0x0F -> C0F
...parameters
Variable arguments: Any
Parameters for instantiation of packet. Mismatch between packet constructor parameters and this variable argument will cause the script throw an exception.
Those methods will either send a packet to the server, or force the client to receive a packet from the server.
isMultiplayer(): Boolean
This method will return if the client is connected to the server.
isSingleplayer(): Boolean
This method will return if the client is playing in singlepalyer.
getServerIP(): String
Returns the server IP, if the player is connected to a server. Otherwise, this returns null.
getServerName(): String
Returns the server name, if the player is connected to a server. Otherwise, this returns null.
getServerMOTD(): String
Returns the server MOTD (Message Of The Day, also known as the text under a server name), if the player is connected to a server.