Add sounds for falling and attached nodes (#7719)
[oweals/minetest.git] / doc / client_lua_api.txt
index 57876670cddd31c83972a7ebd9e32af9da3167bf..3af6334683eb89d602c991e4ab7d06b89f4c62e8 100644 (file)
@@ -1,4 +1,4 @@
-Minetest Lua Client Modding API Reference 5.0.0
+Minetest Lua Client Modding API Reference 5.1.0
 ================================================
 * More information at <http://www.minetest.net/>
 * Developer Wiki: <http://dev.minetest.net/>
@@ -68,8 +68,12 @@ Modpack support
 **NOTE: Not implemented yet.**
 
 Mods can be put in a subdirectory, if the parent directory, which otherwise
-should be a mod, contains a file named `modpack.txt`. This file shall be
-empty, except for lines starting with `#`, which are comments.
+should be a mod, contains a file named `modpack.conf`.
+The file is a key-value store of modpack details.
+
+* `name`: The modpack name.
+* `description`: Description of mod to be shown in the Mods tab of the main
+                 menu.
 
 Mod directory structure
 ------------------------
@@ -646,55 +650,55 @@ Minetest namespace reference
 ### Global callback registration functions
 Call these functions only at load time!
 
-* `minetest.register_globalstep(func(dtime))`
+* `minetest.register_globalstep(function(dtime))`
     * Called every client environment step, usually interval of 0.1s
-* `minetest.register_on_mods_loaded(func())`
+* `minetest.register_on_mods_loaded(function())`
     * Called just after mods have finished loading.
-* `minetest.register_on_shutdown(func())`
+* `minetest.register_on_shutdown(function())`
     * Called before client shutdown
     * **Warning**: If the client terminates abnormally (i.e. crashes), the registered
       callbacks **will likely not be run**. Data should be saved at
       semi-frequent intervals as well as on server shutdown.
-* `minetest.register_on_receiving_chat_message(func(message))`
+* `minetest.register_on_receiving_chat_message(function(message))`
     * Called always when a client receive a message
     * Return `true` to mark the message as handled, which means that it will not be shown to chat
-* `minetest.register_on_sending_chat_message(func(message))`
+* `minetest.register_on_sending_chat_message(function(message))`
     * Called always when a client send a message from chat
     * Return `true` to mark the message as handled, which means that it will not be sent to server
 * `minetest.register_chatcommand(cmd, chatcommand definition)`
     * Adds definition to minetest.registered_chatcommands
 * `minetest.unregister_chatcommand(name)`
     * Unregisters a chatcommands registered with register_chatcommand.
-* `minetest.register_on_death(func())`
+* `minetest.register_on_death(function())`
     * Called when the local player dies
-* `minetest.register_on_hp_modification(func(hp))`
+* `minetest.register_on_hp_modification(function(hp))`
     * Called when server modified player's HP
-* `minetest.register_on_damage_taken(func(hp))`
+* `minetest.register_on_damage_taken(function(hp))`
     * Called when the local player take damages
-* `minetest.register_on_formspec_input(func(formname, fields))`
+* `minetest.register_on_formspec_input(function(formname, fields))`
     * Called when a button is pressed in the local player's inventory form
     * Newest functions are called first
     * If function returns `true`, remaining functions are not called
-* `minetest.register_on_dignode(func(pos, node))`
+* `minetest.register_on_dignode(function(pos, node))`
     * Called when the local player digs a node
     * Newest functions are called first
     * If any function returns true, the node isn't dug
-* `minetest.register_on_punchnode(func(pos, node))`
+* `minetest.register_on_punchnode(function(pos, node))`
     * 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
-* `minetest.register_on_item_use(func(item, pointed_thing))`
+* `minetest.register_on_item_use(function(item, pointed_thing))`
     * Called when the local player uses an item.
     * Newest functions are called first.
     * If any function returns true, the item use is not sent to server.
-* `minetest.register_on_modchannel_message(func(channel_name, sender, message))`
+* `minetest.register_on_modchannel_message(function(channel_name, sender, message))`
     * Called when an incoming mod channel message is received
     * You must have joined some channels before, and server must acknowledge the
       join request.
     * If message comes from a server mod, `sender` field is an empty string.
-* `minetest.register_on_modchannel_signal(func(channel_name, signal))`
+* `minetest.register_on_modchannel_signal(function(channel_name, signal))`
     * Called when a valid incoming mod channel signal is received
     * Signal id permit to react to server mod channel events
     * Possible values are:
@@ -704,7 +708,7 @@ Call these functions only at load time!
       3: leave_failed
       4: event_on_not_joined_channel
       5: state_changed
-* `minetest.register_on_inventory_open(func(inventory))`
+* `minetest.register_on_inventory_open(function(inventory))`
     * Called when the local player open inventory
     * Newest functions are called first
     * If any function returns true, inventory doesn't open
@@ -763,7 +767,7 @@ Call these functions only at load time!
 
 ### Client Environment
 * `minetest.get_player_names()`
-    * Returns list of player names on server
+    * Returns list of player names on server (nil if CSM_RF_READ_PLAYERINFO is enabled by server)
 * `minetest.disconnect()`
     * Disconnect from the server and exit to main menu.
     * Returns `false` if the client is already disconnecting otherwise returns `true`.