]> git.lizzy.rs Git - minetest.git/blobdiff - doc/client_lua_api.md
Add function to get server info.
[minetest.git] / doc / client_lua_api.md
index 43a317a843934e3f19a77f44bb6930503a058763..b76a406eaf594568c32bb74581dca072f5ce3330 100644 (file)
@@ -667,6 +667,8 @@ Call these functions only at load time!
     * Called when the local player punches a node
     * Newest functions are called first
     * If any function returns true, the punch is ignored
+* `minetest.register_on_placenode(function(pointed_thing, node))`    
+    * Called when a node has been placed
 ### Sounds
 * `minetest.sound_play(spec, parameters)`: returns a handle
     * `spec` is a `SimpleSoundSpec`
@@ -700,9 +702,10 @@ Call these functions only at load time!
 * `minetest.disconnect()`
     * Disconnect from the server and exit to main menu.
     * Returns `false` if the client is already disconnecting otherwise returns `true`.
-* `minetest.get_protocol_version()`
-    * Returns the protocol version of the server.
-    * Might not be accurate at start up as the client might not be connected to the server yet, in that case it will return 0.
+* `minetest.take_screenshot()`
+    * Take a screenshot.
+* `minetest.get_server_info()`
+    * Returns [server info](#server-info).
 
 ### Misc.
 * `minetest.parse_json(string[, nullvalue])`: returns something
@@ -779,7 +782,8 @@ An interface to manipulate minimap on client UI
 * `get_angle()`: returns the current minimap angle in degrees
 * `set_mode(mode)`: sets the minimap mode (0 to 6)
 * `get_mode()`: returns the current minimap mode
-* `toggle_shape()`: toggles minimap shape to round or square.
+* `set_shape(shape)`: Sets the minimap shape. (0 = square, 1 = round)
+* `get_shape()`: Gets the minimap shape. (0 = square, 1 = round)
 
 ### LocalPlayer
 An interface to retrieve information about the player. The player is
@@ -805,8 +809,6 @@ Methods:
     * returns player HP
 * `get_name()`
     * returns player name
-* `got_teleported()`
-    * returns true if player was teleported
 * `is_attached()`
     * returns true if player is attached
 * `is_touching_ground()`
@@ -929,9 +931,18 @@ Can be obtained via `minetest.get_meta(pos)`.
     {
         params = "<name> <privilege>", -- Short parameter description
         description = "Remove privilege from player", -- Full description
-        func = function(param), -- Called when command is run.
-                                      -- Returns boolean success and text output.
+        func = function(param),        -- Called when command is run.
+                                       -- Returns boolean success and text output.
     }
+### Server info
+```lua
+{
+       address = "minetest.example.org", -- The domain name/IP address of a remote server or "" for a local server.
+       ip = "203.0.113.156",             -- The IP address of the server.
+       port = 30000,                     -- The port the client is connected to.
+       protocol_version = 30             -- Will not be accurate at start up as the client might not be connected to the server yet, in that case it will be 0.
+}
+```
 
 Escape sequences
 ----------------