X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=doc%2Fclient_lua_api.txt;h=c2c552440fa012d7a3355eef5fbac61ecdcd6663;hb=f345d00a436b88e6583896065aab237ff12a9d3d;hp=c9cd8ac93d0c12a154be9eaa518b8580cb2796d0;hpb=36d35f2fe31a429c1510df680801940472416d45;p=minetest.git diff --git a/doc/client_lua_api.txt b/doc/client_lua_api.txt index c9cd8ac93..c2c552440 100644 --- a/doc/client_lua_api.txt +++ b/doc/client_lua_api.txt @@ -1,4 +1,4 @@ -Minetest Lua Client Modding API Reference 5.3.0 +Minetest Lua Client Modding API Reference 5.5.0 ================================================ * More information at * Developer Wiki: @@ -620,7 +620,7 @@ Helper functions * `minetest.is_yes(arg)` * returns whether `arg` can be interpreted as yes * `minetest.is_nan(arg)` - * returns true true when the passed number represents NaN. + * returns true when the passed number represents NaN. * `table.copy(table)`: returns a table * returns a deep copy of `table` @@ -686,6 +686,11 @@ Call these functions only at load time! * Adds definition to minetest.registered_chatcommands * `minetest.unregister_chatcommand(name)` * Unregisters a chatcommands registered with register_chatcommand. +* `minetest.register_on_chatcommand(function(command, params))` + * Called always when a chatcommand is triggered, before `minetest.registered_chatcommands` + is checked to see if that the command exists, but after the input is parsed. + * Return `true` to mark the command as handled, which means that the default + handlers will be prevented. * `minetest.register_on_death(function())` * Called when the local player dies * `minetest.register_on_hp_modification(function(hp))` @@ -768,12 +773,15 @@ Call these functions only at load time! * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"` * `search_center` is an optional boolean (default: `false`) If true `pos` is also checked for the nodes -* `minetest.find_nodes_in_area(pos1, pos2, nodenames)`: returns a list of - positions. +* `minetest.find_nodes_in_area(pos1, pos2, nodenames, [grouped])` + * `pos1` and `pos2` are the min and max positions of the area to search. * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"` - * First return value: Table with all node positions - * Second return value: Table with the count of each node with the node name - as index. + * If `grouped` is true the return value is a table indexed by node name + which contains lists of positions. + * If `grouped` is false or absent the return values are as follows: + first value: Table with all node positions + second value: Table with the count of each node with the node name + as index * Area volume is limited to 4,096,000 nodes * `minetest.find_nodes_in_area_under_air(pos1, pos2, nodenames)`: returns a list of positions. @@ -993,6 +1001,7 @@ Please do not try to access the reference until the camera is initialized, other ### LocalPlayer An interface to retrieve information about the player. +This object will only be available after the client is initialized. Earlier accesses will yield a `nil` value. Methods: @@ -1097,8 +1106,8 @@ Methods: aux1 = boolean, sneak = boolean, zoom = boolean, - LMB = boolean, - RMB = boolean, + dig = boolean, + place = boolean, } ```