minetest-tools/smartsnippets.json

1 line
294 KiB
JSON

[{"prefix":"get_color_escape_sequence","body":"get_color_escape_sequence(${1:color})","desc":"`minetest.get_color_escape_sequence(color)`:\n* `color` is a ColorString\n* The escape sequence sets the text color to `color`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3107-L3109)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"colorize","body":"colorize(${1:color}, ${2:message})","desc":"`minetest.colorize(color, message)`:\n* Equivalent to:\n `minetest.get_color_escape_sequence(color) ..\n message ..\n minetest.get_color_escape_sequence(\"#ffffff\")`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3110-L3114)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_background_escape_sequence","body":"get_background_escape_sequence(${1:color})","desc":"`minetest.get_background_escape_sequence(color)`\n* `color` is a ColorString\n* The escape sequence sets the background of the whole text element to\n `color`. Only defined for item descriptions and tooltips.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3115-L3118)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"strip_foreground_colors","body":"strip_foreground_colors(${1:str})","desc":"`minetest.strip_foreground_colors(str)`\n* Removes foreground colors added by `get_color_escape_sequence`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3119-L3120)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"strip_background_colors","body":"strip_background_colors(${1:str})","desc":"`minetest.strip_background_colors(str)`\n* Removes background colors added by `get_background_escape_sequence`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3121-L3122)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"strip_colors","body":"strip_colors(${1:str})","desc":"`minetest.strip_colors(str)`\n* Removes all color escape sequences.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3123-L3124)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"new","body":"new(${1:a}${2:[, b}, ${3:c]})","desc":"`vector.new(a[, b, c])`:\n* Returns a vector.\n* A copy of `a` if `a` is a vector.\n* `{x = a, y = b, z = c}`, if all of `a`, `b`, `c` are defined numbers.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3142-L3145)","kind":2,"detail":"Function","token":"vector."},{"prefix":"direction","body":"direction(${1:p1}, ${2:p2})","desc":"`vector.direction(p1, p2)`:\n* Returns a vector of length 1 with direction `p1` to `p2`.\n* If `p1` and `p2` are identical, returns `{x = 0, y = 0, z = 0}`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3146-L3148)","kind":2,"detail":"Function","token":"vector."},{"prefix":"distance","body":"distance(${1:p1}, ${2:p2})","desc":"`vector.distance(p1, p2)`:\n* Returns zero or a positive number, the distance between `p1` and `p2`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3149-L3150)","kind":2,"detail":"Function","token":"vector."},{"prefix":"length","body":"length(${1:v})","desc":"`vector.length(v)`:\n* Returns zero or a positive number, the length of vector `v`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3151-L3152)","kind":2,"detail":"Function","token":"vector."},{"prefix":"normalize","body":"normalize(${1:v})","desc":"`vector.normalize(v)`:\n* Returns a vector of length 1 with direction of vector `v`.\n* If `v` has zero length, returns `{x = 0, y = 0, z = 0}`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3153-L3155)","kind":2,"detail":"Function","token":"vector."},{"prefix":"floor","body":"floor(${1:v})","desc":"`vector.floor(v)`:\n* Returns a vector, each dimension rounded down.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3156-L3157)","kind":2,"detail":"Function","token":"vector."},{"prefix":"round","body":"round(${1:v})","desc":"`vector.round(v)`:\n* Returns a vector, each dimension rounded to nearest integer.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3158-L3159)","kind":2,"detail":"Function","token":"vector."},{"prefix":"apply","body":"apply(${1:v}, ${2:func})","desc":"`vector.apply(v, func)`:\n* Returns a vector where the function `func` has been applied to each\n component.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3160-L3162)","kind":2,"detail":"Function","token":"vector."},{"prefix":"equals","body":"equals(${1:v1}, ${2:v2})","desc":"`vector.equals(v1, v2)`:\n* Returns a boolean, `true` if the vectors are identical.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3163-L3164)","kind":2,"detail":"Function","token":"vector."},{"prefix":"sort","body":"sort(${1:v1}, ${2:v2})","desc":"`vector.sort(v1, v2)`:\n* Returns in order minp, maxp vectors of the cuboid defined by `v1`, `v2`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3165-L3166)","kind":2,"detail":"Function","token":"vector."},{"prefix":"angle","body":"angle(${1:v1}, ${2:v2})","desc":"`vector.angle(v1, v2)`:\n* Returns the angle between `v1` and `v2` in radians.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3167-L3168)","kind":2,"detail":"Function","token":"vector."},{"prefix":"dot","body":"dot(${1:v1}, ${2:v2})","desc":"`vector.dot(v1, v2)`:\n* Returns the dot product of `v1` and `v2`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3169-L3170)","kind":2,"detail":"Function","token":"vector."},{"prefix":"cross","body":"cross(${1:v1}, ${2:v2})","desc":"`vector.cross(v1, v2)`:\n* Returns the cross product of `v1` and `v2`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3171-L3172)","kind":2,"detail":"Function","token":"vector."},{"prefix":"offset","body":"offset(${1:v}, ${2:x}, ${3:y}, ${4:z})","desc":"`vector.offset(v, x, y, z)`:\n* Returns the sum of the vectors `v` and `{x = x, y = y, z = z}`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3173-L3174)","kind":2,"detail":"Function","token":"vector."},{"prefix":"add","body":"add(${1:v}, ${2:x})","desc":"`vector.add(v, x)`:\n* Returns a vector.\n* If `x` is a vector: Returns the sum of `v` and `x`.\n* If `x` is a number: Adds `x` to each component of `v`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3178-L3181)","kind":2,"detail":"Function","token":"vector."},{"prefix":"subtract","body":"subtract(${1:v}, ${2:x})","desc":"`vector.subtract(v, x)`:\n* Returns a vector.\n* If `x` is a vector: Returns the difference of `v` subtracted by `x`.\n* If `x` is a number: Subtracts `x` from each component of `v`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3182-L3185)","kind":2,"detail":"Function","token":"vector."},{"prefix":"multiply","body":"multiply(${1:v}, ${2:s})","desc":"`vector.multiply(v, s)`:\n* Returns a scaled vector.\n* Deprecated: If `s` is a vector: Returns the Schur product.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3186-L3188)","kind":2,"detail":"Function","token":"vector."},{"prefix":"divide","body":"divide(${1:v}, ${2:s})","desc":"`vector.divide(v, s)`:\n* Returns a scaled vector.\n* Deprecated: If `s` is a vector: Returns the Schur quotient.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3189-L3191)","kind":2,"detail":"Function","token":"vector."},{"prefix":"rotate","body":"rotate(${1:v}, ${2:r})","desc":"`vector.rotate(v, r)`:\n* Applies the rotation `r` to `v` and returns the result.\n* `vector.rotate({x = 0, y = 0, z = 1}, r)` and\n `vector.rotate({x = 0, y = 1, z = 0}, r)` return vectors pointing\n forward and up relative to an entity's rotation `r`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3197-L3201)","kind":2,"detail":"Function","token":"vector."},{"prefix":"rotate_around_axis","body":"rotate_around_axis(${1:v1}, ${2:v2}, ${3:a})","desc":"`vector.rotate_around_axis(v1, v2, a)`:\n* Returns `v1` rotated around axis `v2` by `a` radians according to\n the right hand rule.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3202-L3204)","kind":2,"detail":"Function","token":"vector."},{"prefix":"dir_to_rotation","body":"dir_to_rotation(${1:direction}${2:[, up]})","desc":"`vector.dir_to_rotation(direction[, up])`:\n* Returns a rotation vector for `direction` pointing forward using `up`\n as the up vector.\n* If `up` is omitted, the roll of the returned vector defaults to zero.\n* Otherwise `direction` and `up` need to be vectors in a 90 degree angle to each other.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3205-L3209)","kind":2,"detail":"Function","token":"vector."},{"prefix":"hypot","body":"hypot(${1:x}, ${2:y})","desc":"`math.hypot(x, y)`\n* Get the hypotenuse of a triangle with legs x and y.\n Useful for distance calculation.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3225-L3227)","kind":2,"detail":"Function","token":"math."},{"prefix":"sign","body":"sign(${1:x}, ${2:tolerance})","desc":"`math.sign(x, tolerance)`: returns `-1`, `0` or `1`\n* Get the sign of a number.\n* tolerance: number, default: `0.0`\n* If the absolute value of `x` is within the `tolerance` or `x` is NaN,\n `0` is returned.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3228-L3232)","kind":2,"detail":"Function","token":"math."},{"prefix":"factorial","body":"factorial(${1:x})","desc":"`math.factorial(x)`: returns the factorial of `x`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3233-L3233)","kind":2,"detail":"Function","token":"math."},{"prefix":"split","body":"split(${1:str}, ${2:separator}, ${3:include_empty}, ${4:max_splits}, ${5:sep_is_pattern})","desc":"`string.split(str, separator, include_empty, max_splits, sep_is_pattern)`\n* `separator`: string, default: `\",\"`\n* `include_empty`: boolean, default: `false`\n* `max_splits`: number, if it's negative, splits aren't limited,\n default: `-1`\n* `sep_is_pattern`: boolean, it specifies whether separator is a plain\n string or a pattern (regex), default: `false`\n* e.g. `\"a,b\":split\",\"` returns `{\"a\",\"b\"}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3234-L3241)","kind":2,"detail":"Function","token":"string."},{"prefix":"wrap_text","body":"wrap_text(${1:str}, ${2:limit}, ${3:as_table})","desc":"`minetest.wrap_text(str, limit, as_table)`: returns a string or table\n* Adds newlines to the string to keep it within the specified character\n limit\n* Note that the returned lines may be longer than the limit since it only\n splits at word borders.\n* `limit`: number, maximal amount of characters in one line\n* `as_table`: boolean, if set to true, a table of lines instead of a string\n is returned, default: `false`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3244-L3251)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"pos_to_string","body":"pos_to_string(${1:pos}, ${2:decimal_places})","desc":"`minetest.pos_to_string(pos, decimal_places)`: returns string `\"(X,Y,Z)\"`\n* `pos`: table {x=X, y=Y, z=Z}\n* Converts the position `pos` to a human-readable, printable string\n* `decimal_places`: number, if specified, the x, y and z values of\n the position are rounded to the given decimal place.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3252-L3256)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"string_to_pos","body":"string_to_pos(${1:string})","desc":"`minetest.string_to_pos(string)`: returns a position or `nil`\n* Same but in reverse.\n* If the string can't be parsed to a position, nothing is returned.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3257-L3259)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"string_to_area","body":"string_to_area(\"(${1:X1}, ${2:Y1}, ${3:Z1}) (X2, Y2, Z2)\")","desc":"`minetest.string_to_area(\"(X1, Y1, Z1) (X2, Y2, Z2)\")`: returns two positions\n* Converts a string representing an area box into two positions\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3260-L3261)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"formspec_escape","body":"formspec_escape(${1:string})","desc":"`minetest.formspec_escape(string)`: returns a string\n* escapes the characters \"[\", \"]\", \"\\\", \",\" and \";\", which can not be used\n in formspecs.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3262-L3264)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"is_yes","body":"is_yes(${1:arg})","desc":"`minetest.is_yes(arg)`\n* returns true if passed 'y', 'yes', 'true' or a number that isn't zero.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3265-L3266)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"is_nan","body":"is_nan(${1:arg})","desc":"`minetest.is_nan(arg)`\n* returns true when the passed number represents NaN.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3267-L3268)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_us_time","body":"get_us_time()","desc":"`minetest.get_us_time()`\n* returns time with microsecond precision. May not return wall time.\n* This value might overflow on certain 32-bit systems!\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3269-L3271)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"copy","body":"copy(${1:table})","desc":"`table.copy(table)`: returns a table\n* returns a deep copy of `table`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3272-L3273)","kind":2,"detail":"Function","token":"table."},{"prefix":"indexof","body":"indexof(${1:list}, ${2:val})","desc":"`table.indexof(list, val)`: returns the smallest numerical index containing\n the value `val` in the table `list`. Non-numerical indices are ignored.\n If `val` could not be found, `-1` is returned. `list` must not have\n negative indices.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3274-L3277)","kind":2,"detail":"Function","token":"table."},{"prefix":"insert_all","body":"insert_all(${1:table}, ${2:other_table})","desc":"`table.insert_all(table, other_table)`:\n* Appends all values in `other_table` to `table` - uses `#table + 1` to\n find new indices.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3278-L3280)","kind":2,"detail":"Function","token":"table."},{"prefix":"key_value_swap","body":"key_value_swap(${1:t})","desc":"`table.key_value_swap(t)`: returns a table with keys and values swapped\n* If multiple keys in `t` map to the same value, it is unspecified which\n value maps to that key.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3281-L3283)","kind":2,"detail":"Function","token":"table."},{"prefix":"shuffle","body":"shuffle(${1:table}, [${2:from]}, [${3:to]}, [${4:random_func]})","desc":"`table.shuffle(table, [from], [to], [random_func])`:\n* Shuffles elements `from` to `to` in `table` in place\n* `from` defaults to `1`\n* `to` defaults to `#table`\n* `random_func` defaults to `math.random`. This function receives two\n integers as arguments and should return a random integer inclusively\n between them.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3284-L3290)","kind":2,"detail":"Function","token":"table."},{"prefix":"pointed_thing_to_face_pos","body":"pointed_thing_to_face_pos(${1:placer}, ${2:pointed_thing})","desc":"`minetest.pointed_thing_to_face_pos(placer, pointed_thing)`: returns a\n position.\n* returns the exact position on the surface of a pointed node\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3291-L3293)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_dig_params","body":"get_dig_params(${1:groups}, ${2:tool_capabilities})","desc":"`minetest.get_dig_params(groups, tool_capabilities)`: Simulates a tool\nthat digs a node.\nReturns a table with the following fields:\n* `diggable`: `true` if node can be dug, `false` otherwise.\n* `time`: Time it would take to dig the node.\n* `wear`: How much wear would be added to the tool.\n`time` and `wear` are meaningless if node's not diggable\nParameters:\n* `groups`: Table of the node groups of the node that would be dug\n* `tool_capabilities`: Tool capabilities table of the tool\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3294-L3303)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_hit_params","body":"get_hit_params(${1:groups}, ${2:tool_capabilities }${3:[, time_from_last_punch]})","desc":"`minetest.get_hit_params(groups, tool_capabilities [, time_from_last_punch])`:\nSimulates an item that punches an object.\nReturns a table with the following fields:\n* `hp`: How much damage the punch would cause.\n* `wear`: How much wear would be added to the tool.\nParameters:\n* `groups`: Damage groups of the object\n* `tool_capabilities`: Tool capabilities table of the item\n* `time_from_last_punch`: time in seconds since last punch action\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3304-L3312)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_translator","body":"get_translator(${1:textdomain})","desc":"`minetest.get_translator(textdomain)` is a simple wrapper around\n `minetest.translate`, and `minetest.get_translator(textdomain)(str, ...)` is\n equivalent to `minetest.translate(textdomain, str, ...)`.\n It is intended to be used in the following way, so that it avoids verbose\n repetitions of `minetest.translate`:\n\n local S = minetest.get_translator(textdomain)\n S(str, ...)\n\n As an extra commodity, if `textdomain` is nil, it is assumed to be \"\" instead.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3329-L3338)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"translate","body":"translate(${1:textdomain}, ${2:str}, ${3:...})","desc":"`minetest.translate(textdomain, str, ...)` translates the string `str` with\n the given `textdomain` for disambiguation. The textdomain must match the\n textdomain specified in the translation file in order to get the string\n translated. This can be used so that a string is translated differently in\n different contexts.\n It is advised to use the name of the mod as textdomain whenever possible, to\n avoid clashes with other mods.\n This function must be given a number of arguments equal to the number of\n arguments the translated string expects.\n Arguments are literal strings -- they will not be translated, so if you want\n them to be, they need to come as outputs of `minetest.translate` as well.\n\n For instance, suppose we want to translate \"@1 Wool\" with \"@1\" being replaced\n by the translation of \"Red\". We can do the following:\n\n local S = minetest.get_translator()\n S(\"@1 Wool\", S(\"Red\"))\n\n This will be displayed as \"Red Wool\" on old clients and on clients that do\n not have localization enabled. However, if we have for instance a translation\n file named `wool.fr.tr` containing the following:\n\n @1 Wool=Laine @1\n Red=Rouge\n\n this will be displayed as \"Laine Rouge\" on clients with a French locale.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3340-L3365)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"read_from_map","body":"read_from_map(${1:p1}, ${2:p2})","desc":"`read_from_map(p1, p2)`: Loads a chunk of map into the VoxelManip object\n containing the region formed by `p1` and `p2`.\n* returns actual emerged `pmin`, actual emerged `pmax`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4019-L4021)","kind":1,"detail":"Method","token":":"},{"prefix":"write_to_map","body":"write_to_map([${1:light]})","desc":"`write_to_map([light])`: Writes the data loaded from the `VoxelManip` back to\n the map.\n* **important**: data must be set using `VoxelManip:set_data()` before\n calling this.\n* if `light` is true, then lighting is automatically recalculated.\n The default value is true.\n If `light` is false, no light calculations happen, and you should correct\n all modified blocks with `minetest.fix_light()` as soon as possible.\n Keep in mind that modifying the map where light is incorrect can cause\n more lighting bugs.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4022-L4031)","kind":1,"detail":"Method","token":":"},{"prefix":"get_node_at","body":"get_node_at(${1:pos})","desc":"`get_node_at(pos)`: Returns a `MapNode` table of the node currently loaded in\n the `VoxelManip` at that position\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4032-L4033)","kind":1,"detail":"Method","token":":"},{"prefix":"set_node_at","body":"set_node_at(${1:pos}, ${2:node})","desc":"`set_node_at(pos, node)`: Sets a specific `MapNode` in the `VoxelManip` at\n that position.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4034-L4035)","kind":1,"detail":"Method","token":":"},{"prefix":"get_data","body":"get_data([${1:buffer]})","desc":"`get_data([buffer])`: Retrieves the node content data loaded into the\n `VoxelManip` object.\n* returns raw node data in the form of an array of node content IDs\n* if the param `buffer` is present, this table will be used to store the\n result instead.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4036-L4040)","kind":1,"detail":"Method","token":":"},{"prefix":"set_data","body":"set_data(${1:data})","desc":"`set_data(data)`: Sets the data contents of the `VoxelManip` object\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4041-L4041)","kind":1,"detail":"Method","token":":"},{"prefix":"update_map","body":"update_map()","desc":"`update_map()`: Does nothing, kept for compatibility.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4042-L4042)","kind":1,"detail":"Method","token":":"},{"prefix":"set_lighting","body":"set_lighting(${1:light}, [${2:p1}, ${3:p2]})","desc":"`set_lighting(light, [p1, p2])`: Set the lighting within the `VoxelManip` to\n a uniform value.\n* `light` is a table, `{day=<0...15>, night=<0...15>}`\n* To be used only by a `VoxelManip` object from\n `minetest.get_mapgen_object`.\n* (`p1`, `p2`) is the area in which lighting is set, defaults to the whole\n area if left out.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4043-L4049)","kind":1,"detail":"Method","token":":"},{"prefix":"get_light_data","body":"get_light_data()","desc":"`get_light_data()`: Gets the light data read into the `VoxelManip` object\n* Returns an array (indices 1 to volume) of integers ranging from `0` to\n `255`.\n* Each value is the bitwise combination of day and night light values\n (`0` to `15` each).\n* `light = day + (night * 16)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4050-L4055)","kind":1,"detail":"Method","token":":"},{"prefix":"set_light_data","body":"set_light_data(${1:light_data})","desc":"`set_light_data(light_data)`: Sets the `param1` (light) contents of each node\n in the `VoxelManip`.\n* expects lighting data in the same format that `get_light_data()` returns\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4056-L4058)","kind":1,"detail":"Method","token":":"},{"prefix":"get_param2_data","body":"get_param2_data([${1:buffer]})","desc":"`get_param2_data([buffer])`: Gets the raw `param2` data read into the\n `VoxelManip` object.\n* Returns an array (indices 1 to volume) of integers ranging from `0` to\n `255`.\n* If the param `buffer` is present, this table will be used to store the\n result instead.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4059-L4064)","kind":1,"detail":"Method","token":":"},{"prefix":"set_param2_data","body":"set_param2_data(${1:param2_data})","desc":"`set_param2_data(param2_data)`: Sets the `param2` contents of each node in\n the `VoxelManip`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4065-L4066)","kind":1,"detail":"Method","token":":"},{"prefix":"calc_lighting","body":"calc_lighting([${1:p1}, ${2:p2]}, [${3:propagate_shadow]})","desc":"`calc_lighting([p1, p2], [propagate_shadow])`: Calculate lighting within the\n `VoxelManip`.\n* To be used only by a `VoxelManip` object from\n `minetest.get_mapgen_object`.\n* (`p1`, `p2`) is the area in which lighting is set, defaults to the whole\n area if left out or nil. For almost all uses these should be left out\n or nil to use the default.\n* `propagate_shadow` is an optional boolean deciding whether shadows in a\n generated mapchunk above are propagated down into the mapchunk, defaults\n to `true` if left out.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4067-L4076)","kind":1,"detail":"Method","token":":"},{"prefix":"update_liquids","body":"update_liquids()","desc":"`update_liquids()`: Update liquid flow\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4077-L4077)","kind":1,"detail":"Method","token":":"},{"prefix":"was_modified","body":"was_modified()","desc":"`was_modified()`: Returns `true` or `false` if the data in the voxel\n manipulator had been modified since the last read from map, due to a call to\n `minetest.set_data()` on the loaded area elsewhere.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4078-L4080)","kind":1,"detail":"Method","token":":"},{"prefix":"get_emerged_area","body":"get_emerged_area()","desc":"`get_emerged_area()`: Returns actual emerged minimum and maximum positions.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4081-L4081)","kind":1,"detail":"Method","token":":"},{"prefix":"getExtent","body":"getExtent()","desc":"`getExtent()`: returns a 3D vector containing the size of the area formed by\n `MinEdge` and `MaxEdge`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4092-L4093)","kind":1,"detail":"Method","token":":"},{"prefix":"getVolume","body":"getVolume()","desc":"`getVolume()`: returns the volume of the area formed by `MinEdge` and\n `MaxEdge`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4094-L4095)","kind":1,"detail":"Method","token":":"},{"prefix":"index","body":"index(${1:x}, ${2:y}, ${3:z})","desc":"`index(x, y, z)`: returns the index of an absolute position in a flat array\n starting at `1`.\n* `x`, `y` and `z` must be integers to avoid an incorrect index result.\n* The position (x, y, z) is not checked for being inside the area volume,\n being outside can cause an incorrect index result.\n* Useful for things like `VoxelManip`, raw Schematic specifiers,\n `PerlinNoiseMap:get2d`/`3dMap`, and so on.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4096-L4102)","kind":1,"detail":"Method","token":":"},{"prefix":"indexp","body":"indexp(${1:p})","desc":"`indexp(p)`: same functionality as `index(x, y, z)` but takes a vector.\n* As with `index(x, y, z)`, the components of `p` must be integers, and `p`\n is not checked for being inside the area volume.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4103-L4105)","kind":1,"detail":"Method","token":":"},{"prefix":"position","body":"position(${1:i})","desc":"`position(i)`: returns the absolute position vector corresponding to index\n `i`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4106-L4107)","kind":1,"detail":"Method","token":":"},{"prefix":"contains","body":"contains(${1:x}, ${2:y}, ${3:z})","desc":"`contains(x, y, z)`: check if (`x`,`y`,`z`) is inside area formed by\n `MinEdge` and `MaxEdge`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4108-L4109)","kind":1,"detail":"Method","token":":"},{"prefix":"containsp","body":"containsp(${1:p})","desc":"`containsp(p)`: same as above, except takes a vector\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4110-L4110)","kind":1,"detail":"Method","token":":"},{"prefix":"containsi","body":"containsi(${1:i})","desc":"`containsi(i)`: same as above, except takes an index `i`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4111-L4111)","kind":1,"detail":"Method","token":":"},{"prefix":"iter","body":"iter(${1:minx}, ${2:miny}, ${3:minz}, ${4:maxx}, ${5:maxy}, ${6:maxz})","desc":"`iter(minx, miny, minz, maxx, maxy, maxz)`: returns an iterator that returns\n indices.\n* from (`minx`,`miny`,`minz`) to (`maxx`,`maxy`,`maxz`) in the order of\n `[z [y [x]]]`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4112-L4115)","kind":1,"detail":"Method","token":":"},{"prefix":"iterp","body":"iterp(${1:minp}, ${2:maxp})","desc":"`iterp(minp, maxp)`: same as above, except takes a vector\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4116-L4116)","kind":1,"detail":"Method","token":":"},{"prefix":"on_activate","body":"on_activate(${1:self}, ${2:staticdata}, ${3:dtime_s})","desc":"`on_activate(self, staticdata, dtime_s)`\n* Called when the object is instantiated.\n* `dtime_s` is the time passed since the object was unloaded, which can be\n used for updating the entity state.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4217-L4220)","kind":1,"detail":"Method","token":":"},{"prefix":"on_deactivate","body":"on_deactivate(${1:self})","desc":"`on_deactivate(self)\n* Called when the object is about to get removed or unloaded.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4221-L4222)","kind":1,"detail":"Method","token":":"},{"prefix":"on_step","body":"on_step(${1:self}, ${2:dtime})","desc":"`on_step(self, dtime)`\n* Called on every server tick, after movement and collision processing.\n `dtime` is usually 0.1 seconds, as per the `dedicated_server_step` setting\n in `minetest.conf`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4223-L4226)","kind":1,"detail":"Method","token":":"},{"prefix":"on_punch","body":"on_punch(${1:self}, ${2:puncher}, ${3:time_from_last_punch}, ${4:tool_capabilities}, ${5:dir}, ${6:damage})","desc":"`on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir, damage)`\n* Called when somebody punches the object.\n* Note that you probably want to handle most punches using the automatic\n armor group system.\n* `puncher`: an `ObjectRef` (can be `nil`)\n* `time_from_last_punch`: Meant for disallowing spamming of clicks\n (can be `nil`).\n* `tool_capabilities`: capability table of used tool (can be `nil`)\n* `dir`: unit vector of direction of punch. Always defined. Points from the\n puncher to the punched.\n* `damage`: damage that will be done to entity.\n* Can return `true` to prevent the default damage mechanism.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4227-L4238)","kind":1,"detail":"Method","token":":"},{"prefix":"on_death","body":"on_death(${1:self}, ${2:killer})","desc":"`on_death(self, killer)`\n* Called when the object dies.\n* `killer`: an `ObjectRef` (can be `nil`)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4239-L4241)","kind":1,"detail":"Method","token":":"},{"prefix":"on_rightclick","body":"on_rightclick(${1:self}, ${2:clicker})","desc":"`on_rightclick(self, clicker)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4242-L4242)","kind":1,"detail":"Method","token":":"},{"prefix":"on_attach_child","body":"on_attach_child(${1:self}, ${2:child})","desc":"`on_attach_child(self, child)`\n* `child`: an `ObjectRef` of the child that attaches\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4243-L4244)","kind":1,"detail":"Method","token":":"},{"prefix":"on_detach_child","body":"on_detach_child(${1:self}, ${2:child})","desc":"`on_detach_child(self, child)`\n* `child`: an `ObjectRef` of the child that detaches\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4245-L4246)","kind":1,"detail":"Method","token":":"},{"prefix":"on_detach","body":"on_detach(${1:self}, ${2:parent})","desc":"`on_detach(self, parent)`\n* `parent`: an `ObjectRef` (can be `nil`) from where it got detached\n* This happens before the parent object is removed from the world\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4247-L4249)","kind":1,"detail":"Method","token":":"},{"prefix":"get_staticdata","body":"get_staticdata(${1:self})","desc":"`get_staticdata(self)`\n* Should return a string that will be passed to `on_activate` when the\n object is instantiated the next time.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4250-L4252)","kind":1,"detail":"Method","token":":"},{"prefix":"get_current_modname","body":"get_current_modname()","desc":"`minetest.get_current_modname()`: returns the currently loading mod's name,\n when loading a mod.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4341-L4342)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_modpath","body":"get_modpath(${1:modname})","desc":"`minetest.get_modpath(modname)`: returns the directory path for a mod,\n e.g. `\"/home/user/.minetest/usermods/modname\"`.\n* Returns nil if the mod is not enabled or does not exist (not installed).\n* Works regardless of whether the mod has been loaded yet.\n* Useful for loading additional `.lua` modules or static data from a mod,\n or checking if a mod is enabled.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4343-L4348)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_modnames","body":"get_modnames()","desc":"`minetest.get_modnames()`: returns a list of enabled mods, sorted alphabetically.\n* Does not include disabled mods, even if they are installed.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4349-L4350)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_worldpath","body":"get_worldpath()","desc":"`minetest.get_worldpath()`: returns e.g. `\"/home/user/.minetest/world\"`\n* Useful for storing custom data\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4351-L4352)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"is_singleplayer","body":"is_singleplayer()","desc":"`minetest.is_singleplayer()`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4353-L4353)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"has_feature","body":"has_feature(${1:arg})","desc":"`minetest.has_feature(arg)`: returns `boolean, missing_features`\n* `arg`: string or table in format `{foo=true, bar=true}`\n* `missing_features`: `{foo=true, bar=true}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4397-L4399)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_player_information","body":"get_player_information(${1:player_name})","desc":"`minetest.get_player_information(player_name)`: Table containing information\n about a player. Example return value:\n\n {\n address = \"127.0.0.1\", -- IP address of client\n ip_version = 4, -- IPv4 / IPv6\n connection_uptime = 200, -- seconds since client connected\n protocol_version = 32, -- protocol version used by client\n formspec_version = 2, -- supported formspec version\n lang_code = \"fr\" -- Language code used for translation\n -- the following keys can be missing if no stats have been collected yet\n min_rtt = 0.01, -- minimum round trip time\n max_rtt = 0.2, -- maximum round trip time\n avg_rtt = 0.02, -- average round trip time\n min_jitter = 0.01, -- minimum packet time jitter\n max_jitter = 0.5, -- maximum packet time jitter\n avg_jitter = 0.03, -- average packet time jitter\n -- the following information is available in a debug build only!!!\n -- DO NOT USE IN MODS\n --ser_vers = 26, -- serialization version used by client\n --major = 0, -- major version number\n --minor = 4, -- minor version number\n --patch = 10, -- patch version number\n --vers_string = \"0.4.9-git\", -- full version string\n --state = \"Active\" -- current client state\n }\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4400-L4425)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"mkdir","body":"mkdir(${1:path})","desc":"`minetest.mkdir(path)`: returns success.\n* Creates a directory specified by `path`, creating parent directories\n if they don't exist.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4427-L4429)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_dir_list","body":"get_dir_list(${1:path}, [${2:is_dir]})","desc":"`minetest.get_dir_list(path, [is_dir])`: returns list of entry names\n* is_dir is one of:\n * nil: return all entries,\n * true: return only subdirectory names, or\n * false: return only file names.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4430-L4434)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"safe_file_write","body":"safe_file_write(${1:path}, ${2:content})","desc":"`minetest.safe_file_write(path, content)`: returns boolean indicating success\n* Replaces contents of file at path with new contents in a safe (atomic)\n way. Use this instead of below code when writing e.g. database files:\n `local f = io.open(path, \"wb\"); f:write(content); f:close()`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4435-L4438)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_version","body":"get_version()","desc":"`minetest.get_version()`: returns a table containing components of the\n engine version. Components:\n* `project`: Name of the project, eg, \"Minetest\"\n* `string`: Simple version, eg, \"1.2.3-dev\"\n* `hash`: Full git version (only set if available),\n eg, \"1.2.3-dev-01234567-dirty\".\n Use this for informational purposes only. The information in the returned\n table does not represent the capabilities of the engine, nor is it\n reliable or verifiable. Compatible forks will have a different name and\n version entirely. To check for the presence of engine features, test\n whether the functions exported by the wanted features exist. For example:\n `if minetest.check_for_falling then ... end`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4439-L4450)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"sha1","body":"sha1(${1:data}, [${2:raw]})","desc":"`minetest.sha1(data, [raw])`: returns the sha1 hash of data\n* `data`: string of data to hash\n* `raw`: return raw bytes instead of hex digits, default: false\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4451-L4453)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"debug","body":"debug(${1:...})","desc":"`minetest.debug(...)`\n* Equivalent to `minetest.log(table.concat({...}, \"\\t\"))`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4458-L4459)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"log","body":"log([${1:level},${2:] text})","desc":"`minetest.log([level,] text)`\n* `level` is one of `\"none\"`, `\"error\"`, `\"warning\"`, `\"action\"`,\n `\"info\"`, or `\"verbose\"`. Default is `\"none\"`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4460-L4462)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_node","body":"register_node(${1:name}, ${2:node definition})","desc":"`minetest.register_node(name, node definition)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4471-L4471)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_craftitem","body":"register_craftitem(${1:name}, ${2:item definition})","desc":"`minetest.register_craftitem(name, item definition)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4472-L4472)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_tool","body":"register_tool(${1:name}, ${2:item definition})","desc":"`minetest.register_tool(name, item definition)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4473-L4473)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"override_item","body":"override_item(${1:name}, ${2:redefinition})","desc":"`minetest.override_item(name, redefinition)`\n* Overrides fields of an item registered with register_node/tool/craftitem.\n* Note: Item must already be defined, (opt)depend on the mod defining it.\n* Example: `minetest.override_item(\"default:mese\",\n {light_source=minetest.LIGHT_MAX})`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4474-L4478)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"unregister_item","body":"unregister_item(${1:name})","desc":"`minetest.unregister_item(name)`\n* Unregisters the item from the engine, and deletes the entry with key\n `name` from `minetest.registered_items` and from the associated item table\n according to its nature: `minetest.registered_nodes`, etc.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4479-L4482)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_entity","body":"register_entity(${1:name}, ${2:entity definition})","desc":"`minetest.register_entity(name, entity definition)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4483-L4483)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_abm","body":"register_abm(${1:abm definition})","desc":"`minetest.register_abm(abm definition)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4484-L4484)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_lbm","body":"register_lbm(${1:lbm definition})","desc":"`minetest.register_lbm(lbm definition)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4485-L4485)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_alias","body":"register_alias(${1:alias}, ${2:original_name})","desc":"`minetest.register_alias(alias, original_name)`\n* Also use this to set the 'mapgen aliases' needed in a game for the core\n mapgens. See [Mapgen aliases] section above.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4486-L4488)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_alias_force","body":"register_alias_force(${1:alias}, ${2:original_name})","desc":"`minetest.register_alias_force(alias, original_name)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4489-L4489)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_ore","body":"register_ore(${1:ore definition})","desc":"`minetest.register_ore(ore definition)`\n* Returns an integer object handle uniquely identifying the registered\n ore on success.\n* The order of ore registrations determines the order of ore generation.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4490-L4493)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_biome","body":"register_biome(${1:biome definition})","desc":"`minetest.register_biome(biome definition)`\n* Returns an integer object handle uniquely identifying the registered\n biome on success. To get the biome ID, use `minetest.get_biome_id`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4494-L4496)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"unregister_biome","body":"unregister_biome(${1:name})","desc":"`minetest.unregister_biome(name)`\n* Unregisters the biome from the engine, and deletes the entry with key\n `name` from `minetest.registered_biomes`.\n* Warning: This alters the biome to biome ID correspondences, so any\n decorations or ores using the 'biomes' field must afterwards be cleared\n and re-registered.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4497-L4502)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_decoration","body":"register_decoration(${1:decoration definition})","desc":"`minetest.register_decoration(decoration definition)`\n* Returns an integer object handle uniquely identifying the registered\n decoration on success. To get the decoration ID, use\n `minetest.get_decoration_id`.\n* The order of decoration registrations determines the order of decoration\n generation.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4503-L4508)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_schematic","body":"register_schematic(${1:schematic definition})","desc":"`minetest.register_schematic(schematic definition)`\n* Returns an integer object handle uniquely identifying the registered\n schematic on success.\n* If the schematic is loaded from a file, the `name` field is set to the\n filename.\n* If the function is called when loading the mod, and `name` is a relative\n path, then the current mod path will be prepended to the schematic\n filename.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4509-L4516)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"clear_registered_biomes","body":"clear_registered_biomes()","desc":"`minetest.clear_registered_biomes()`\n* Clears all biomes currently registered.\n* Warning: Clearing and re-registering biomes alters the biome to biome ID\n correspondences, so any decorations or ores using the 'biomes' field must\n afterwards be cleared and re-registered.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4517-L4521)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"clear_registered_decorations","body":"clear_registered_decorations()","desc":"`minetest.clear_registered_decorations()`\n* Clears all decorations currently registered.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4522-L4523)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"clear_registered_ores","body":"clear_registered_ores()","desc":"`minetest.clear_registered_ores()`\n* Clears all ores currently registered.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4524-L4525)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"clear_registered_schematics","body":"clear_registered_schematics()","desc":"`minetest.clear_registered_schematics()`\n* Clears all schematics currently registered.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4526-L4527)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_craft","body":"register_craft(${1:recipe})","desc":"`minetest.register_craft(recipe)`\n* Check recipe table syntax for different types below.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4531-L4532)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"clear_craft","body":"clear_craft(${1:recipe})","desc":"`minetest.clear_craft(recipe)`\n* Will erase existing craft based either on output item or on input recipe.\n* Specify either output or input only. If you specify both, input will be\n ignored. For input use the same recipe table syntax as for\n `minetest.register_craft(recipe)`. For output specify only the item,\n without a quantity.\n* Returns false if no erase candidate could be found, otherwise returns true.\n* **Warning**! The type field (\"shaped\", \"cooking\" or any other) will be\n ignored if the recipe contains output. Erasing is then done independently\n from the crafting method.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4533-L4542)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_chatcommand","body":"register_chatcommand(${1:cmd}, ${2:chatcommand definition})","desc":"`minetest.register_chatcommand(cmd, chatcommand definition)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4543-L4543)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"override_chatcommand","body":"override_chatcommand(${1:name}, ${2:redefinition})","desc":"`minetest.override_chatcommand(name, redefinition)`\n* Overrides fields of a chatcommand registered with `register_chatcommand`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4544-L4545)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"unregister_chatcommand","body":"unregister_chatcommand(${1:name})","desc":"`minetest.unregister_chatcommand(name)`\n* Unregisters a chatcommands registered with `register_chatcommand`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4546-L4547)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_privilege","body":"register_privilege(${1:name}, ${2:definition})","desc":"`minetest.register_privilege(name, definition)`\n* `definition` can be a description or a definition table (see [Privilege\n definition]).\n* If it is a description, the priv will be granted to singleplayer and admin\n by default.\n* To allow players with `basic_privs` to grant, see the `basic_privs`\n minetest.conf setting.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4548-L4554)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_authentication_handler","body":"register_authentication_handler(${1:authentication handler definition})","desc":"`minetest.register_authentication_handler(authentication handler definition)`\n* Registers an auth handler that overrides the builtin one.\n* This function can be called by a single mod once only.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4555-L4557)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_globalstep","body":"register_globalstep(function(${1:dtime})\n\t$0\nend)","desc":"`minetest.register_globalstep(function(dtime))`\n* Called every server step, usually interval of 0.1s\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4564-L4565)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_mods_loaded","body":"register_on_mods_loaded(function()\n\t$0\nend)","desc":"`minetest.register_on_mods_loaded(function())`\n* Called after mods have finished loading and before the media is cached or the\n aliases handled.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4566-L4568)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_shutdown","body":"register_on_shutdown(function()\n\t$0\nend)","desc":"`minetest.register_on_shutdown(function())`\n* Called before server shutdown\n* **Warning**: If the server terminates abnormally (i.e. crashes), the\n registered callbacks **will likely not be run**. Data should be saved at\n semi-frequent intervals as well as on server shutdown.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4569-L4573)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_placenode","body":"register_on_placenode(function(${1:pos}, ${2:newnode}, ${3:placer}, ${4:oldnode}, ${5:itemstack}, ${6:pointed_thing})\n\t$0\nend)","desc":"`minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing))`\n* Called when a node has been placed\n* If return `true` no item is taken from `itemstack`\n* `placer` may be any valid ObjectRef or nil.\n* **Not recommended**; use `on_construct` or `after_place_node` in node\n definition whenever possible.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4574-L4579)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_dignode","body":"register_on_dignode(function(${1:pos}, ${2:oldnode}, ${3:digger})\n\t$0\nend)","desc":"`minetest.register_on_dignode(function(pos, oldnode, digger))`\n* Called when a node has been dug.\n* **Not recommended**; Use `on_destruct` or `after_dig_node` in node\n definition whenever possible.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4580-L4583)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_punchnode","body":"register_on_punchnode(function(${1:pos}, ${2:node}, ${3:puncher}, ${4:pointed_thing})\n\t$0\nend)","desc":"`minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing))`\n* Called when a node is punched\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4584-L4585)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_generated","body":"register_on_generated(function(${1:minp}, ${2:maxp}, ${3:blockseed})\n\t$0\nend)","desc":"`minetest.register_on_generated(function(minp, maxp, blockseed))`\n* Called after generating a piece of world. Modifying nodes inside the area\n is a bit faster than usually.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4586-L4588)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_newplayer","body":"register_on_newplayer(function(${1:ObjectRef})\n\t$0\nend)","desc":"`minetest.register_on_newplayer(function(ObjectRef))`\n* Called when a new player enters the world for the first time\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4589-L4590)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_punchplayer","body":"register_on_punchplayer(function(${1:player}, ${2:hitter}, ${3:time_from_last_punch}, ${4:tool_capabilities}, ${5:dir}, ${6:damage})\n\t$0\nend)","desc":"`minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage))`\n* Called when a player is punched\n* Note: This callback is invoked even if the punched player is dead.\n* `player`: ObjectRef - Player that was punched\n* `hitter`: ObjectRef - Player that hit\n* `time_from_last_punch`: Meant for disallowing spamming of clicks\n (can be nil).\n* `tool_capabilities`: Capability table of used tool (can be nil)\n* `dir`: Unit vector of direction of punch. Always defined. Points from\n the puncher to the punched.\n* `damage`: Number that represents the damage calculated by the engine\n* should return `true` to prevent the default damage mechanism\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4591-L4602)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_rightclickplayer","body":"register_on_rightclickplayer(function(${1:player}, ${2:clicker})\n\t$0\nend)","desc":"`minetest.register_on_rightclickplayer(function(player, clicker))`\n* Called when a player is right-clicked\n* `player`: ObjectRef - Player that was right-clicked\n* `clicker`: ObjectRef - Object that right-clicked, may or may not be a player\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4603-L4606)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_player_hpchange","body":"register_on_player_hpchange(function(${1:player}, ${2:hp_change}, ${3:reason}), ${4:modifier}\n\t$0\nend)","desc":"`minetest.register_on_player_hpchange(function(player, hp_change, reason), modifier)`\n* Called when the player gets damaged or healed\n* `player`: ObjectRef of the player\n* `hp_change`: the amount of change. Negative when it is damage.\n* `reason`: a PlayerHPChangeReason table.\n * The `type` field will have one of the following values:\n * `set_hp`: A mod or the engine called `set_hp` without\n giving a type - use this for custom damage types.\n * `punch`: Was punched. `reason.object` will hold the puncher, or nil if none.\n * `fall`\n * `node_damage`: `damage_per_second` from a neighbouring node.\n `reason.node` will hold the node name or nil.\n * `drown`\n * `respawn`\n * Any of the above types may have additional fields from mods.\n * `reason.from` will be `mod` or `engine`.\n* `modifier`: when true, the function should return the actual `hp_change`.\n Note: modifiers only get a temporary `hp_change` that can be modified by later modifiers.\n Modifiers can return true as a second argument to stop the execution of further functions.\n Non-modifiers receive the final HP change calculated by the modifiers.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4607-L4626)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_dieplayer","body":"register_on_dieplayer(function(${1:ObjectRef}, ${2:reason})\n\t$0\nend)","desc":"`minetest.register_on_dieplayer(function(ObjectRef, reason))`\n* Called when a player dies\n* `reason`: a PlayerHPChangeReason table, see register_on_player_hpchange\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4627-L4629)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_respawnplayer","body":"register_on_respawnplayer(function(${1:ObjectRef})\n\t$0\nend)","desc":"`minetest.register_on_respawnplayer(function(ObjectRef))`\n* Called when player is to be respawned\n* Called _before_ repositioning of player occurs\n* return true in func to disable regular player placement\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4630-L4633)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_prejoinplayer","body":"register_on_prejoinplayer(function(${1:name}, ${2:ip})\n\t$0\nend)","desc":"`minetest.register_on_prejoinplayer(function(name, ip))`\n* Called when a client connects to the server, prior to authentication\n* If it returns a string, the client is disconnected with that string as\n reason.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4634-L4637)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_joinplayer","body":"register_on_joinplayer(function(${1:ObjectRef}, ${2:last_login})\n\t$0\nend)","desc":"`minetest.register_on_joinplayer(function(ObjectRef, last_login))`\n* Called when a player joins the game\n* `last_login`: The timestamp of the previous login, or nil if player is new\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4638-L4640)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_leaveplayer","body":"register_on_leaveplayer(function(${1:ObjectRef}, ${2:timed_out})\n\t$0\nend)","desc":"`minetest.register_on_leaveplayer(function(ObjectRef, timed_out))`\n* Called when a player leaves the game\n* `timed_out`: True for timeout, false for other reasons.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4641-L4643)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_authplayer","body":"register_on_authplayer(function(${1:name}, ${2:ip}, ${3:is_success})\n\t$0\nend)","desc":"`minetest.register_on_authplayer(function(name, ip, is_success))`\n* Called when a client attempts to log into an account.\n* `name`: The name of the account being authenticated.\n* `ip`: The IP address of the client\n* `is_success`: Whether the client was successfully authenticated\n* For newly registered accounts, `is_success` will always be true\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4644-L4649)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_auth_fail","body":"register_on_auth_fail(function(${1:name}, ${2:ip})\n\t$0\nend)","desc":"`minetest.register_on_auth_fail(function(name, ip))`\n* Deprecated: use `minetest.register_on_authplayer(name, ip, is_success)` instead.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4650-L4651)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_cheat","body":"register_on_cheat(function(${1:ObjectRef}, ${2:cheat})\n\t$0\nend)","desc":"`minetest.register_on_cheat(function(ObjectRef, cheat))`\n* Called when a player cheats\n* `cheat`: `{type=<cheat_type>}`, where `<cheat_type>` is one of:\n * `moved_too_fast`\n * `interacted_too_far`\n * `interacted_with_self`\n * `interacted_while_dead`\n * `finished_unknown_dig`\n * `dug_unbreakable`\n * `dug_too_fast`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4652-L4661)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_chat_message","body":"register_on_chat_message(function(${1:name}, ${2:message})\n\t$0\nend)","desc":"`minetest.register_on_chat_message(function(name, message))`\n* Called always when a player says something\n* Return `true` to mark the message as handled, which means that it will\n not be sent to other players.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4662-L4665)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_chatcommand","body":"register_on_chatcommand(function(${1:name}, ${2:command}, ${3:params})\n\t$0\nend)","desc":"`minetest.register_on_chatcommand(function(name, command, params))`\n* Called always when a chatcommand is triggered, before `minetest.registered_chatcommands`\n is checked to see if the command exists, but after the input is parsed.\n* Return `true` to mark the command as handled, which means that the default\n handlers will be prevented.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4666-L4670)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_player_receive_fields","body":"register_on_player_receive_fields(function(${1:player}, ${2:formname}, ${3:fields})\n\t$0\nend)","desc":"`minetest.register_on_player_receive_fields(function(player, formname, fields))`\n* Called when the server received input from `player` in a formspec with\n the given `formname`. Specifically, this is called on any of the\n following events:\n * a button was pressed,\n * Enter was pressed while the focus was on a text field\n * a checkbox was toggled,\n * something was selected in a dropdown list,\n * a different tab was selected,\n * selection was changed in a textlist or table,\n * an entry was double-clicked in a textlist or table,\n * a scrollbar was moved, or\n * the form was actively closed by the player.\n* Fields are sent for formspec elements which define a field. `fields`\n is a table containing each formspecs element value (as string), with\n the `name` parameter as index for each. The value depends on the\n formspec element type:\n * `animated_image`: Returns the index of the current frame.\n * `button` and variants: If pressed, contains the user-facing button\n text as value. If not pressed, is `nil`\n * `field`, `textarea` and variants: Text in the field\n * `dropdown`: Either the index or value, depending on the `index event`\n dropdown argument.\n * `tabheader`: Tab index, starting with `\"1\"` (only if tab changed)\n * `checkbox`: `\"true\"` if checked, `\"false\"` if unchecked\n * `textlist`: See `minetest.explode_textlist_event`\n * `table`: See `minetest.explode_table_event`\n * `scrollbar`: See `minetest.explode_scrollbar_event`\n * Special case: `[\"quit\"]=\"true\"` is sent when the user actively\n closed the form by mouse click, keypress or through a button_exit[]\n element.\n * Special case: `[\"key_enter\"]=\"true\"` is sent when the user pressed\n the Enter key and the focus was either nowhere (causing the formspec\n to be closed) or on a button. If the focus was on a text field,\n additionally, the index `key_enter_field` contains the name of the\n text field. See also: `field_close_on_enter`.\n* Newest functions are called first\n* If function returns `true`, remaining functions are not called\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4671-L4708)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_craft","body":"register_on_craft(function(${1:itemstack}, ${2:player}, ${3:old_craft_grid}, ${4:craft_inv})\n\t$0\nend)","desc":"`minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv))`\n* Called when `player` crafts something\n* `itemstack` is the output\n* `old_craft_grid` contains the recipe (Note: the one in the inventory is\n cleared).\n* `craft_inv` is the inventory with the crafting grid\n* Return either an `ItemStack`, to replace the output, or `nil`, to not\n modify it.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4709-L4716)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_craft_predict","body":"register_craft_predict(function(${1:itemstack}, ${2:player}, ${3:old_craft_grid}, ${4:craft_inv})\n\t$0\nend)","desc":"`minetest.register_craft_predict(function(itemstack, player, old_craft_grid, craft_inv))`\n* The same as before, except that it is called before the player crafts, to\n make craft prediction, and it should not change anything.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4717-L4719)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_allow_player_inventory_action","body":"register_allow_player_inventory_action(function(${1:player}, ${2:action}, ${3:inventory}, ${4:inventory_info})\n\t$0\nend)","desc":"`minetest.register_allow_player_inventory_action(function(player, action, inventory, inventory_info))`\n* Determines how much of a stack may be taken, put or moved to a\n player inventory.\n* `player` (type `ObjectRef`) is the player who modified the inventory\n `inventory` (type `InvRef`).\n* List of possible `action` (string) values and their\n `inventory_info` (table) contents:\n * `move`: `{from_list=string, to_list=string, from_index=number, to_index=number, count=number}`\n * `put`: `{listname=string, index=number, stack=ItemStack}`\n * `take`: Same as `put`\n* Return a numeric value to limit the amount of items to be taken, put or\n moved. A value of `-1` for `take` will make the source stack infinite.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4720-L4731)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_player_inventory_action","body":"register_on_player_inventory_action(function(${1:player}, ${2:action}, ${3:inventory}, ${4:inventory_info})\n\t$0\nend)","desc":"`minetest.register_on_player_inventory_action(function(player, action, inventory, inventory_info))`\n* Called after a take, put or move event from/to/in a player inventory\n* Function arguments: see `minetest.register_allow_player_inventory_action`\n* Does not accept or handle any return value.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4732-L4735)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_protection_violation","body":"register_on_protection_violation(function(${1:pos}, ${2:name})\n\t$0\nend)","desc":"`minetest.register_on_protection_violation(function(pos, name))`\n* Called by `builtin` and mods when a player violates protection at a\n position (eg, digs a node or punches a protected entity).\n* The registered functions can be called using\n `minetest.record_protection_violation`.\n* The provided function should check that the position is protected by the\n mod calling this function before it prints a message, if it does, to\n allow for multiple protection mods.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4736-L4743)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_item_eat","body":"register_on_item_eat(function(${1:hp_change}, ${2:replace_with_item}, ${3:itemstack}, ${4:user}, ${5:pointed_thing})\n\t$0\nend)","desc":"`minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing))`\n* Called when an item is eaten, by `minetest.item_eat`\n* Return `itemstack` to cancel the default item eat response (i.e.: hp increase).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4744-L4746)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_priv_grant","body":"register_on_priv_grant(function(${1:name}, ${2:granter}, ${3:priv})\n\t$0\nend)","desc":"`minetest.register_on_priv_grant(function(name, granter, priv))`\n* Called when `granter` grants the priv `priv` to `name`.\n* Note that the callback will be called twice if it's done by a player,\n once with granter being the player name, and again with granter being nil.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4747-L4750)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_priv_revoke","body":"register_on_priv_revoke(function(${1:name}, ${2:revoker}, ${3:priv})\n\t$0\nend)","desc":"`minetest.register_on_priv_revoke(function(name, revoker, priv))`\n* Called when `revoker` revokes the priv `priv` from `name`.\n* Note that the callback will be called twice if it's done by a player,\n once with revoker being the player name, and again with revoker being nil.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4751-L4754)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_can_bypass_userlimit","body":"register_can_bypass_userlimit(function(${1:name}, ${2:ip})\n\t$0\nend)","desc":"`minetest.register_can_bypass_userlimit(function(name, ip))`\n* Called when `name` user connects with `ip`.\n* Return `true` to by pass the player limit\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4755-L4757)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"register_on_modchannel_message","body":"register_on_modchannel_message(function(${1:channel_name}, ${2:sender}, ${3:message})\n\t$0\nend)","desc":"`minetest.register_on_modchannel_message(function(channel_name, sender, message))`\n* Called when an incoming mod channel message is received\n* You should have joined some channels to receive events.\n* If message comes from a server mod, `sender` field is an empty string.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4758-L4761)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"setting_get_pos","body":"setting_get_pos(${1:name})","desc":"`minetest.setting_get_pos(name)`: Loads a setting from the main settings and\n parses it as a position (in the format `(1,2,3)`). Returns a position or nil.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4768-L4769)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"string_to_privs","body":"string_to_privs(${1:str}${2:[, delim]})","desc":"`minetest.string_to_privs(str[, delim])`:\n* Converts string representation of privs into table form\n* `delim`: String separating the privs. Defaults to `\",\"`.\n* Returns `{ priv1 = true, ... }`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4774-L4777)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"privs_to_string","body":"privs_to_string(${1:privs}${2:[, delim]})","desc":"`minetest.privs_to_string(privs[, delim])`:\n* Returns the string representation of `privs`\n* `delim`: String to delimit privs. Defaults to `\",\"`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4778-L4780)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_player_privs","body":"get_player_privs(${1:name}) -> {priv1=true,...}","desc":"`minetest.get_player_privs(name) -> {priv1=true,...}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4781-L4781)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"check_player_privs","body":"check_player_privs(${1:player_or_name}, ${2:...})","desc":"`minetest.check_player_privs(player_or_name, ...)`:\n returns `bool, missing_privs`\n* A quickhand for checking privileges.\n* `player_or_name`: Either a Player object or the name of a player.\n* `...` is either a list of strings, e.g. `\"priva\", \"privb\"` or\n a table, e.g. `{ priva = true, privb = true }`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4782-L4787)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"check_password_entry","body":"check_password_entry(${1:name}, ${2:entry}, ${3:password})","desc":"`minetest.check_password_entry(name, entry, password)`\n* Returns true if the \"password entry\" for a player with name matches given\n password, false otherwise.\n* The \"password entry\" is the password representation generated by the\n engine as returned as part of a `get_auth()` call on the auth handler.\n* Only use this function for making it possible to log in via password from\n external protocols such as IRC, other uses are frowned upon.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4789-L4795)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_password_hash","body":"get_password_hash(${1:name}, ${2:raw_password})","desc":"`minetest.get_password_hash(name, raw_password)`\n* Convert a name-password pair to a password hash that Minetest can use.\n* The returned value alone is not a good basis for password checks based\n on comparing the password hash in the database with the password hash\n from the function, with an externally provided password, as the hash\n in the db might use the new SRP verifier format.\n* For this purpose, use `minetest.check_password_entry` instead.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4796-L4802)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_player_ip","body":"get_player_ip(${1:name})","desc":"`minetest.get_player_ip(name)`: returns an IP address string for the player\n `name`.\n* The player needs to be online for this to be successful.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4803-L4805)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_auth_handler","body":"get_auth_handler()","desc":"`minetest.get_auth_handler()`: Return the currently active auth handler\n* See the [Authentication handler definition]\n* Use this to e.g. get the authentication data for a player:\n `local auth_data = minetest.get_auth_handler().get_auth(playername)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4807-L4810)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"notify_authentication_modified","body":"notify_authentication_modified(${1:name})","desc":"`minetest.notify_authentication_modified(name)`\n* Must be called by the authentication handler for privilege changes.\n* `name`: string; if omitted, all auth data should be considered modified\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4811-L4813)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"set_player_password","body":"set_player_password(${1:name}, ${2:password_hash})","desc":"`minetest.set_player_password(name, password_hash)`: Set password hash of\n player `name`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4814-L4815)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"set_player_privs","body":"set_player_privs(${1:name}, {${2:priv1}=${3:true},${4:...}})","desc":"`minetest.set_player_privs(name, {priv1=true,...})`: Set privileges of player\n `name`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4816-L4817)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"auth_reload","body":"auth_reload()","desc":"`minetest.auth_reload()`\n* See `reload()` in authentication handler definition\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4818-L4819)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"chat_send_all","body":"chat_send_all(${1:text})","desc":"`minetest.chat_send_all(text)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4828-L4828)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"chat_send_player","body":"chat_send_player(${1:name}, ${2:text})","desc":"`minetest.chat_send_player(name, text)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4829-L4829)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"format_chat_message","body":"format_chat_message(${1:name}, ${2:message})","desc":"`minetest.format_chat_message(name, message)`\n* Used by the server to format a chat message, based on the setting `chat_message_format`.\n Refer to the documentation of the setting for a list of valid placeholders.\n* Takes player name and message, and returns the formatted string to be sent to players.\n* Can be redefined by mods if required, for things like colored names or messages.\n* **Only** the first occurrence of each placeholder will be replaced.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4830-L4835)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"set_node","body":"set_node(${1:pos}, ${2:node})","desc":"`minetest.set_node(pos, node)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4840-L4840)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"add_node","body":"add_node(${1:pos}, ${2:node})","desc":"`minetest.add_node(pos, node)`: alias to `minetest.set_node`\n* Set node at position `pos`\n* `node`: table `{name=string, param1=number, param2=number}`\n* If param1 or param2 is omitted, it's set to `0`.\n* e.g. `minetest.set_node({x=0, y=10, z=0}, {name=\"default:wood\"})`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4841-L4845)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"bulk_set_node","body":"bulk_set_node({${1:pos1}, ${2:pos2}, ${3:pos3}, ${4:...}}, ${5:node})","desc":"`minetest.bulk_set_node({pos1, pos2, pos3, ...}, node)`\n* Set node on all positions set in the first argument.\n* e.g. `minetest.bulk_set_node({{x=0, y=1, z=1}, {x=1, y=2, z=2}}, {name=\"default:stone\"})`\n* For node specification or position syntax see `minetest.set_node` call\n* Faster than set_node due to single call, but still considerably slower\n than Lua Voxel Manipulators (LVM) for large numbers of nodes.\n Unlike LVMs, this will call node callbacks. It also allows setting nodes\n in spread out positions which would cause LVMs to waste memory.\n For setting a cube, this is 1.3x faster than set_node whereas LVM is 20\n times faster.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4846-L4855)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"swap_node","body":"swap_node(${1:pos}, ${2:node})","desc":"`minetest.swap_node(pos, node)`\n* Set node at position, but don't remove metadata\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4856-L4857)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"remove_node","body":"remove_node(${1:pos})","desc":"`minetest.remove_node(pos)`\n* By default it does the same as `minetest.set_node(pos, {name=\"air\"})`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4858-L4859)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_node","body":"get_node(${1:pos})","desc":"`minetest.get_node(pos)`\n* Returns the node at the given position as table in the format\n `{name=\"node_name\", param1=0, param2=0}`,\n returns `{name=\"ignore\", param1=0, param2=0}` for unloaded areas.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4860-L4863)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_node_or_nil","body":"get_node_or_nil(${1:pos})","desc":"`minetest.get_node_or_nil(pos)`\n* Same as `get_node` but returns `nil` for unloaded areas.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4864-L4865)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_node_light","body":"get_node_light(${1:pos}, ${2:timeofday})","desc":"`minetest.get_node_light(pos, timeofday)`\n* Gets the light value at the given position. Note that the light value\n \"inside\" the node at the given position is returned, so you usually want\n to get the light value of a neighbor.\n* `pos`: The position where to measure the light.\n* `timeofday`: `nil` for current time, `0` for night, `0.5` for day\n* Returns a number between `0` and `15` or `nil`\n* `nil` is returned e.g. when the map isn't loaded at `pos`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4866-L4873)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_natural_light","body":"get_natural_light(${1:pos}${2:[, timeofday]})","desc":"`minetest.get_natural_light(pos[, timeofday])`\n* Figures out the sunlight (or moonlight) value at pos at the given time of\n day.\n* `pos`: The position of the node\n* `timeofday`: `nil` for current time, `0` for night, `0.5` for day\n* Returns a number between `0` and `15` or `nil`\n* This function tests 203 nodes in the worst case, which happens very\n unlikely\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4874-L4881)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_artificial_light","body":"get_artificial_light(${1:param1})","desc":"`minetest.get_artificial_light(param1)`\n* Calculates the artificial light (light from e.g. torches) value from the\n `param1` value.\n* `param1`: The param1 value of a `paramtype = \"light\"` node.\n* Returns a number between `0` and `15`\n* Currently it's the same as `math.floor(param1 / 16)`, except that it\n ensures compatibility.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4882-L4888)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"place_node","body":"place_node(${1:pos}, ${2:node})","desc":"`minetest.place_node(pos, node)`\n* Place node with the same effects that a player would cause\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4889-L4890)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"dig_node","body":"dig_node(${1:pos})","desc":"`minetest.dig_node(pos)`\n* Dig node with the same effects that a player would cause\n* Returns `true` if successful, `false` on failure (e.g. protected location)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4891-L4893)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"punch_node","body":"punch_node(${1:pos})","desc":"`minetest.punch_node(pos)`\n* Punch node with the same effects that a player would cause\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4894-L4895)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"spawn_falling_node","body":"spawn_falling_node(${1:pos})","desc":"`minetest.spawn_falling_node(pos)`\n* Change node into falling node\n* Returns `true` if successful, `false` on failure\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4896-L4898)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"find_nodes_with_meta","body":"find_nodes_with_meta(${1:pos1}, ${2:pos2})","desc":"`minetest.find_nodes_with_meta(pos1, pos2)`\n* Get a table of positions of nodes that have metadata within a region\n {pos1, pos2}.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4900-L4902)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_meta","body":"get_meta(${1:pos})","desc":"`minetest.get_meta(pos)`\n* Get a `NodeMetaRef` at that position\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4903-L4904)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_node_timer","body":"get_node_timer(${1:pos})","desc":"`minetest.get_node_timer(pos)`\n* Get `NodeTimerRef`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4905-L4906)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"add_entity","body":"add_entity(${1:pos}, ${2:name}, [${3:staticdata]})","desc":"`minetest.add_entity(pos, name, [staticdata])`: Spawn Lua-defined entity at\n position.\n* Returns `ObjectRef`, or `nil` if failed\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4908-L4910)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"add_item","body":"add_item(${1:pos}, ${2:item})","desc":"`minetest.add_item(pos, item)`: Spawn item\n* Returns `ObjectRef`, or `nil` if failed\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4911-L4912)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_player_by_name","body":"get_player_by_name(${1:name})","desc":"`minetest.get_player_by_name(name)`: Get an `ObjectRef` to a player\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4913-L4913)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_objects_inside_radius","body":"get_objects_inside_radius(${1:pos}, ${2:radius})","desc":"`minetest.get_objects_inside_radius(pos, radius)`: returns a list of\n ObjectRefs.\n* `radius`: using an euclidean metric\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4914-L4916)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_objects_in_area","body":"get_objects_in_area(${1:pos1}, ${2:pos2})","desc":"`minetest.get_objects_in_area(pos1, pos2)`: returns a list of\n ObjectRefs.\n * `pos1` and `pos2` are the min and max positions of the area to search.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4917-L4919)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"set_timeofday","body":"set_timeofday(${1:val})","desc":"`minetest.set_timeofday(val)`\n* `val` is between `0` and `1`; `0` for midnight, `0.5` for midday\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4920-L4921)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_timeofday","body":"get_timeofday()","desc":"`minetest.get_timeofday()`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4922-L4922)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_gametime","body":"get_gametime()","desc":"`minetest.get_gametime()`: returns the time, in seconds, since the world was\n created.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4923-L4924)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_day_count","body":"get_day_count()","desc":"`minetest.get_day_count()`: returns number days elapsed since world was\n created.\n* accounts for time changes.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4925-L4927)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"find_node_near","body":"find_node_near(${1:pos}, ${2:radius}, ${3:nodenames}, [${4:search_center]})","desc":"`minetest.find_node_near(pos, radius, nodenames, [search_center])`: returns\n pos or `nil`.\n* `radius`: using a maximum metric\n* `nodenames`: e.g. `{\"ignore\", \"group:tree\"}` or `\"default:dirt\"`\n* `search_center` is an optional boolean (default: `false`)\n If true `pos` is also checked for the nodes\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4928-L4933)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"find_nodes_in_area","body":"find_nodes_in_area(${1:pos1}, ${2:pos2}, ${3:nodenames}, [${4:grouped]})","desc":"`minetest.find_nodes_in_area(pos1, pos2, nodenames, [grouped])`\n* `pos1` and `pos2` are the min and max positions of the area to search.\n* `nodenames`: e.g. `{\"ignore\", \"group:tree\"}` or `\"default:dirt\"`\n* If `grouped` is true the return value is a table indexed by node name\n which contains lists of positions.\n* If `grouped` is false or absent the return values are as follows:\n first value: Table with all node positions\n second value: Table with the count of each node with the node name\n as index\n* Area volume is limited to 4,096,000 nodes\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4934-L4943)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"find_nodes_in_area_under_air","body":"find_nodes_in_area_under_air(${1:pos1}, ${2:pos2}, ${3:nodenames})","desc":"`minetest.find_nodes_in_area_under_air(pos1, pos2, nodenames)`: returns a\n list of positions.\n* `nodenames`: e.g. `{\"ignore\", \"group:tree\"}` or `\"default:dirt\"`\n* Return value: Table with all node positions with a node air above\n* Area volume is limited to 4,096,000 nodes\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4944-L4948)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_perlin","body":"get_perlin(${1:noiseparams})","desc":"`minetest.get_perlin(noiseparams)`\n* Return world-specific perlin noise.\n* The actual seed used is the noiseparams seed plus the world seed.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4949-L4951)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_perlin","body":"get_perlin(${1:seeddiff}, ${2:octaves}, ${3:persistence}, ${4:spread})","desc":"`minetest.get_perlin(seeddiff, octaves, persistence, spread)`\n* Deprecated: use `minetest.get_perlin(noiseparams)` instead.\n* Return world-specific perlin noise.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4952-L4954)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_voxel_manip","body":"get_voxel_manip([${1:pos1}, ${2:pos2]})","desc":"`minetest.get_voxel_manip([pos1, pos2])`\n* Return voxel manipulator object.\n* Loads the manipulator from the map if positions are passed.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4955-L4957)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"set_gen_notify","body":"set_gen_notify(${1:flags}, {${2:deco_ids}})","desc":"`minetest.set_gen_notify(flags, {deco_ids})`\n* Set the types of on-generate notifications that should be collected.\n* `flags` is a flag field with the available flags:\n * dungeon\n * temple\n * cave_begin\n * cave_end\n * large_cave_begin\n * large_cave_end\n * decoration\n* The second parameter is a list of IDs of decorations which notification\n is requested for.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4958-L4969)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_gen_notify","body":"get_gen_notify()","desc":"`minetest.get_gen_notify()`\n* Returns a flagstring and a table with the `deco_id`s.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4970-L4971)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_decoration_id","body":"get_decoration_id(${1:decoration_name})","desc":"`minetest.get_decoration_id(decoration_name)`\n* Returns the decoration ID number for the provided decoration name string,\n or `nil` on failure.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4972-L4974)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_mapgen_object","body":"get_mapgen_object(${1:objectname})","desc":"`minetest.get_mapgen_object(objectname)`\n* Return requested mapgen object if available (see [Mapgen objects])\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4975-L4976)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_heat","body":"get_heat(${1:pos})","desc":"`minetest.get_heat(pos)`\n* Returns the heat at the position, or `nil` on failure.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4977-L4978)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_humidity","body":"get_humidity(${1:pos})","desc":"`minetest.get_humidity(pos)`\n* Returns the humidity at the position, or `nil` on failure.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4979-L4980)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_biome_data","body":"get_biome_data(${1:pos})","desc":"`minetest.get_biome_data(pos)`\n* Returns a table containing:\n * `biome` the biome id of the biome at that position\n * `heat` the heat at the position\n * `humidity` the humidity at the position\n* Or returns `nil` on failure.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4981-L4986)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_biome_id","body":"get_biome_id(${1:biome_name})","desc":"`minetest.get_biome_id(biome_name)`\n* Returns the biome id, as used in the biomemap Mapgen object and returned\n by `minetest.get_biome_data(pos)`, for a given biome_name string.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4987-L4989)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_biome_name","body":"get_biome_name(${1:biome_id})","desc":"`minetest.get_biome_name(biome_id)`\n* Returns the biome name string for the provided biome id, or `nil` on\n failure.\n* If no biomes have been registered, such as in mgv6, returns `default`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4990-L4993)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_mapgen_params","body":"get_mapgen_params()","desc":"`minetest.get_mapgen_params()`\n* Deprecated: use `minetest.get_mapgen_setting(name)` instead.\n* Returns a table containing:\n * `mgname`\n * `seed`\n * `chunksize`\n * `water_level`\n * `flags`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4994-L5001)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"set_mapgen_params","body":"set_mapgen_params(${1:MapgenParams})","desc":"`minetest.set_mapgen_params(MapgenParams)`\n* Deprecated: use `minetest.set_mapgen_setting(name, value, override)`\n instead.\n* Set map generation parameters.\n* Function cannot be called after the registration period; only\n initialization and `on_mapgen_init`.\n* Takes a table as an argument with the fields:\n * `mgname`\n * `seed`\n * `chunksize`\n * `water_level`\n * `flags`\n* Leave field unset to leave that parameter unchanged.\n* `flags` contains a comma-delimited string of flags to set, or if the\n prefix `\"no\"` is attached, clears instead.\n* `flags` is in the same format and has the same options as `mg_flags` in\n `minetest.conf`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5002-L5018)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_mapgen_setting","body":"get_mapgen_setting(${1:name})","desc":"`minetest.get_mapgen_setting(name)`\n* Gets the *active* mapgen setting (or nil if none exists) in string\n format with the following order of precedence:\n 1) Settings loaded from map_meta.txt or overrides set during mod\n execution.\n 2) Settings set by mods without a metafile override\n 3) Settings explicitly set in the user config file, minetest.conf\n 4) Settings set as the user config default\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5019-L5026)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_mapgen_setting_noiseparams","body":"get_mapgen_setting_noiseparams(${1:name})","desc":"`minetest.get_mapgen_setting_noiseparams(name)`\n* Same as above, but returns the value as a NoiseParams table if the\n setting `name` exists and is a valid NoiseParams.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5027-L5029)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"set_mapgen_setting","body":"set_mapgen_setting(${1:name}, ${2:value}, [${3:override_meta]})","desc":"`minetest.set_mapgen_setting(name, value, [override_meta])`\n* Sets a mapgen param to `value`, and will take effect if the corresponding\n mapgen setting is not already present in map_meta.txt.\n* `override_meta` is an optional boolean (default: `false`). If this is set\n to true, the setting will become the active setting regardless of the map\n metafile contents.\n* Note: to set the seed, use `\"seed\"`, not `\"fixed_map_seed\"`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5030-L5036)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"set_mapgen_setting_noiseparams","body":"set_mapgen_setting_noiseparams(${1:name}, ${2:value}, [${3:override_meta]})","desc":"`minetest.set_mapgen_setting_noiseparams(name, value, [override_meta])`\n* Same as above, except value is a NoiseParams table.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5037-L5038)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"set_noiseparams","body":"set_noiseparams(${1:name}, ${2:noiseparams}, ${3:set_default})","desc":"`minetest.set_noiseparams(name, noiseparams, set_default)`\n* Sets the noiseparams setting of `name` to the noiseparams table specified\n in `noiseparams`.\n* `set_default` is an optional boolean (default: `true`) that specifies\n whether the setting should be applied to the default config or current\n active config.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5039-L5044)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_noiseparams","body":"get_noiseparams(${1:name})","desc":"`minetest.get_noiseparams(name)`\n* Returns a table of the noiseparams for name.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5045-L5046)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"generate_ores","body":"generate_ores(${1:vm}, ${2:pos1}, ${3:pos2})","desc":"`minetest.generate_ores(vm, pos1, pos2)`\n* Generate all registered ores within the VoxelManip `vm` and in the area\n from `pos1` to `pos2`.\n* `pos1` and `pos2` are optional and default to mapchunk minp and maxp.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5047-L5050)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"generate_decorations","body":"generate_decorations(${1:vm}, ${2:pos1}, ${3:pos2})","desc":"`minetest.generate_decorations(vm, pos1, pos2)`\n* Generate all registered decorations within the VoxelManip `vm` and in the\n area from `pos1` to `pos2`.\n* `pos1` and `pos2` are optional and default to mapchunk minp and maxp.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5051-L5054)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"clear_objects","body":"clear_objects([${1:options]})","desc":"`minetest.clear_objects([options])`\n* Clear all objects in the environment\n* Takes an optional table as an argument with the field `mode`.\n * mode = `\"full\"` : Load and go through every mapblock, clearing\n objects (default).\n * mode = `\"quick\"`: Clear objects immediately in loaded mapblocks,\n clear objects in unloaded mapblocks only when the\n mapblocks are next activated.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5055-L5062)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"load_area","body":"load_area(${1:pos1}${2:[, pos2]})","desc":"`minetest.load_area(pos1[, pos2])`\n* Load the mapblocks containing the area from `pos1` to `pos2`.\n `pos2` defaults to `pos1` if not specified.\n* This function does not trigger map generation.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5063-L5066)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"emerge_area","body":"emerge_area(${1:pos1}, ${2:pos2}, [${3:callback]}, [${4:param]})","desc":"`minetest.emerge_area(pos1, pos2, [callback], [param])`\n* Queue all blocks in the area from `pos1` to `pos2`, inclusive, to be\n asynchronously fetched from memory, loaded from disk, or if inexistent,\n generates them.\n* If `callback` is a valid Lua function, this will be called for each block\n emerged.\n* The function signature of callback is:\n `function EmergeAreaCallback(blockpos, action, calls_remaining, param)`\n * `blockpos` is the *block* coordinates of the block that had been\n emerged.\n * `action` could be one of the following constant values:\n * `minetest.EMERGE_CANCELLED`\n * `minetest.EMERGE_ERRORED`\n * `minetest.EMERGE_FROM_MEMORY`\n * `minetest.EMERGE_FROM_DISK`\n * `minetest.EMERGE_GENERATED`\n * `calls_remaining` is the number of callbacks to be expected after\n this one.\n * `param` is the user-defined parameter passed to emerge_area (or\n nil if the parameter was absent).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5067-L5086)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"delete_area","body":"delete_area(${1:pos1}, ${2:pos2})","desc":"`minetest.delete_area(pos1, pos2)`\n* delete all mapblocks in the area from pos1 to pos2, inclusive\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5087-L5088)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"line_of_sight","body":"line_of_sight(${1:pos1}, ${2:pos2})","desc":"`minetest.line_of_sight(pos1, pos2)`: returns `boolean, pos`\n* Checks if there is anything other than air between pos1 and pos2.\n* Returns false if something is blocking the sight.\n* Returns the position of the blocking node when `false`\n* `pos1`: First position\n* `pos2`: Second position\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5089-L5094)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"raycast","body":"raycast(${1:pos1}, ${2:pos2}, ${3:objects}, ${4:liquids})","desc":"`minetest.raycast(pos1, pos2, objects, liquids)`: returns `Raycast`\n* Creates a `Raycast` object.\n* `pos1`: start of the ray\n* `pos2`: end of the ray\n* `objects`: if false, only nodes will be returned. Default is `true`.\n* `liquids`: if false, liquid nodes won't be returned. Default is `false`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5095-L5100)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"find_path","body":"find_path(${1:pos1},${2:pos2},${3:searchdistance},${4:max_jump},${5:max_drop},${6:algorithm})","desc":"`minetest.find_path(pos1,pos2,searchdistance,max_jump,max_drop,algorithm)`\n* returns table containing path that can be walked on\n* returns a table of 3D points representing a path from `pos1` to `pos2` or\n `nil` on failure.\n* Reasons for failure:\n * No path exists at all\n * No path exists within `searchdistance` (see below)\n * Start or end pos is buried in land\n* `pos1`: start position\n* `pos2`: end position\n* `searchdistance`: maximum distance from the search positions to search in.\n In detail: Path must be completely inside a cuboid. The minimum\n `searchdistance` of 1 will confine search between `pos1` and `pos2`.\n Larger values will increase the size of this cuboid in all directions\n* `max_jump`: maximum height difference to consider walkable\n* `max_drop`: maximum height difference to consider droppable\n* `algorithm`: One of `\"A*_noprefetch\"` (default), `\"A*\"`, `\"Dijkstra\"`.\n Difference between `\"A*\"` and `\"A*_noprefetch\"` is that\n `\"A*\"` will pre-calculate the cost-data, the other will calculate it\n on-the-fly\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5101-L5120)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"spawn_tree ","body":"spawn_tree (${1:pos}, {${2:treedef}})","desc":"`minetest.spawn_tree (pos, {treedef})`\n* spawns L-system tree at given `pos` with definition in `treedef` table\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5121-L5122)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"transforming_liquid_add","body":"transforming_liquid_add(${1:pos})","desc":"`minetest.transforming_liquid_add(pos)`\n* add node to liquid update queue\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5123-L5124)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_node_max_level","body":"get_node_max_level(${1:pos})","desc":"`minetest.get_node_max_level(pos)`\n* get max available level for leveled node\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5125-L5126)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_node_level","body":"get_node_level(${1:pos})","desc":"`minetest.get_node_level(pos)`\n* get level of leveled node (water, snow)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5127-L5128)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"set_node_level","body":"set_node_level(${1:pos}, ${2:level})","desc":"`minetest.set_node_level(pos, level)`\n* set level of leveled node, default `level` equals `1`\n* if `totallevel > maxlevel`, returns rest (`total-max`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5129-L5131)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"add_node_level","body":"add_node_level(${1:pos}, ${2:level})","desc":"`minetest.add_node_level(pos, level)`\n* increase level of leveled node by level, default `level` equals `1`\n* if `totallevel > maxlevel`, returns rest (`total-max`)\n* `level` must be between -127 and 127\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5132-L5135)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"fix_light","body":"fix_light(${1:pos1}, ${2:pos2})","desc":"`minetest.fix_light(pos1, pos2)`: returns `true`/`false`\n* resets the light in a cuboid-shaped part of\n the map and removes lighting bugs.\n* Loads the area if it is not loaded.\n* `pos1` is the corner of the cuboid with the least coordinates\n (in node coordinates), inclusive.\n* `pos2` is the opposite corner of the cuboid, inclusive.\n* The actual updated cuboid might be larger than the specified one,\n because only whole map blocks can be updated.\n The actual updated area consists of those map blocks that intersect\n with the given cuboid.\n* However, the neighborhood of the updated area might change\n as well, as light can spread out of the cuboid, also light\n might be removed.\n* returns `false` if the area is not fully generated,\n `true` otherwise\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5136-L5151)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"check_single_for_falling","body":"check_single_for_falling(${1:pos})","desc":"`minetest.check_single_for_falling(pos)`\n* causes an unsupported `group:falling_node` node to fall and causes an\n unattached `group:attached_node` node to fall.\n* does not spread these updates to neighbours.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5152-L5155)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"check_for_falling","body":"check_for_falling(${1:pos})","desc":"`minetest.check_for_falling(pos)`\n* causes an unsupported `group:falling_node` node to fall and causes an\n unattached `group:attached_node` node to fall.\n* spread these updates to neighbours and can cause a cascade\n of nodes to fall.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5156-L5160)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_spawn_level","body":"get_spawn_level(${1:x}, ${2:z})","desc":"`minetest.get_spawn_level(x, z)`\n* Returns a player spawn y co-ordinate for the provided (x, z)\n co-ordinates, or `nil` for an unsuitable spawn point.\n* For most mapgens a 'suitable spawn point' is one with y between\n `water_level` and `water_level + 16`, and in mgv7 well away from rivers,\n so `nil` will be returned for many (x, z) co-ordinates.\n* The spawn level returned is for a player spawn in unmodified terrain.\n* The spawn level is intentionally above terrain level to cope with\n full-node biome 'dust' nodes.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5161-L5169)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"mod_channel_join","body":"mod_channel_join(${1:channel_name})","desc":"`minetest.mod_channel_join(channel_name)`\n* Server joins channel `channel_name`, and creates it if necessary. You\n should listen for incoming messages with\n `minetest.register_on_modchannel_message`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5176-L5179)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"create_detached_inventory","body":"create_detached_inventory(${1:name}, ${2:callbacks}, [${3:player_name]})","desc":"`minetest.create_detached_inventory(name, callbacks, [player_name])`: returns\n an `InvRef`.\n* `callbacks`: See [Detached inventory callbacks]\n* `player_name`: Make detached inventory available to one player\n exclusively, by default they will be sent to every player (even if not\n used).\n Note that this parameter is mostly just a workaround and will be removed\n in future releases.\n* Creates a detached inventory. If it already exists, it is cleared.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5190-L5198)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"remove_detached_inventory","body":"remove_detached_inventory(${1:name})","desc":"`minetest.remove_detached_inventory(name)`\n* Returns a `boolean` indicating whether the removal succeeded.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5199-L5200)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"do_item_eat","body":"do_item_eat(${1:hp_change}, ${2:replace_with_item}, ${3:itemstack}, ${4:user}, ${5:pointed_thing})","desc":"`minetest.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)`:\n returns left over ItemStack.\n* See `minetest.item_eat` and `minetest.register_on_item_eat`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5201-L5203)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"show_formspec","body":"show_formspec(${1:playername}, ${2:formname}, ${3:formspec})","desc":"`minetest.show_formspec(playername, formname, formspec)`\n* `playername`: name of player to show formspec\n* `formname`: name passed to `on_player_receive_fields` callbacks.\n It should follow the `\"modname:<whatever>\"` naming convention\n* `formspec`: formspec to display\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5208-L5212)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"close_formspec","body":"close_formspec(${1:playername}, ${2:formname})","desc":"`minetest.close_formspec(playername, formname)`\n* `playername`: name of player to close formspec\n* `formname`: has to exactly match the one given in `show_formspec`, or the\n formspec will not close.\n* calling `show_formspec(playername, formname, \"\")` is equal to this\n expression.\n* to close a formspec regardless of the formname, call\n `minetest.close_formspec(playername, \"\")`.\n **USE THIS ONLY WHEN ABSOLUTELY NECESSARY!**\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5213-L5221)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"formspec_escape","body":"formspec_escape(${1:string})","desc":"`minetest.formspec_escape(string)`: returns a string\n* escapes the characters \"[\", \"]\", \"\\\", \",\" and \";\", which can not be used\n in formspecs.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3262-L3264)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"explode_table_event","body":"explode_table_event(${1:string})","desc":"`minetest.explode_table_event(string)`: returns a table\n* returns e.g. `{type=\"CHG\", row=1, column=2}`\n* `type` is one of:\n * `\"INV\"`: no row selected\n * `\"CHG\"`: selected\n * `\"DCL\"`: double-click\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5225-L5230)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"explode_textlist_event","body":"explode_textlist_event(${1:string})","desc":"`minetest.explode_textlist_event(string)`: returns a table\n* returns e.g. `{type=\"CHG\", index=1}`\n* `type` is one of:\n * `\"INV\"`: no row selected\n * `\"CHG\"`: selected\n * `\"DCL\"`: double-click\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5231-L5236)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"explode_scrollbar_event","body":"explode_scrollbar_event(${1:string})","desc":"`minetest.explode_scrollbar_event(string)`: returns a table\n* returns e.g. `{type=\"CHG\", value=500}`\n* `type` is one of:\n * `\"INV\"`: something failed\n * `\"CHG\"`: has been changed\n * `\"VAL\"`: not changed\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5237-L5242)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"inventorycube","body":"inventorycube(${1:img1}, ${2:img2}, ${3:img3})","desc":"`minetest.inventorycube(img1, img2, img3)`\n* Returns a string for making an image of a cube (useful as an item image)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5247-L5248)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_pointed_thing_position","body":"get_pointed_thing_position(${1:pointed_thing}, ${2:above})","desc":"`minetest.get_pointed_thing_position(pointed_thing, above)`\n* Returns the position of a `pointed_thing` or `nil` if the `pointed_thing`\n does not refer to a node or entity.\n* If the optional `above` parameter is true and the `pointed_thing` refers\n to a node, then it will return the `above` position of the `pointed_thing`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5249-L5253)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"dir_to_facedir","body":"dir_to_facedir(${1:dir}, ${2:is6d})","desc":"`minetest.dir_to_facedir(dir, is6d)`\n* Convert a vector to a facedir value, used in `param2` for\n `paramtype2=\"facedir\"`.\n* passing something non-`nil`/`false` for the optional second parameter\n causes it to take the y component into account.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5254-L5258)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"facedir_to_dir","body":"facedir_to_dir(${1:facedir})","desc":"`minetest.facedir_to_dir(facedir)`\n* Convert a facedir back into a vector aimed directly out the \"back\" of a\n node.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5259-L5261)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"dir_to_wallmounted","body":"dir_to_wallmounted(${1:dir})","desc":"`minetest.dir_to_wallmounted(dir)`\n* Convert a vector to a wallmounted value, used for\n `paramtype2=\"wallmounted\"`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5262-L5264)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"wallmounted_to_dir","body":"wallmounted_to_dir(${1:wallmounted})","desc":"`minetest.wallmounted_to_dir(wallmounted)`\n* Convert a wallmounted value back into a vector aimed directly out the\n \"back\" of a node.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5265-L5267)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"dir_to_yaw","body":"dir_to_yaw(${1:dir})","desc":"`minetest.dir_to_yaw(dir)`\n* Convert a vector into a yaw (angle)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5268-L5269)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"yaw_to_dir","body":"yaw_to_dir(${1:yaw})","desc":"`minetest.yaw_to_dir(yaw)`\n* Convert yaw (angle) to a vector\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5270-L5271)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"is_colored_paramtype","body":"is_colored_paramtype(${1:ptype})","desc":"`minetest.is_colored_paramtype(ptype)`\n* Returns a boolean. Returns `true` if the given `paramtype2` contains\n color information (`color`, `colorwallmounted` or `colorfacedir`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5272-L5274)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"strip_param2_color","body":"strip_param2_color(${1:param2}, ${2:paramtype2})","desc":"`minetest.strip_param2_color(param2, paramtype2)`\n* Removes everything but the color information from the\n given `param2` value.\n* Returns `nil` if the given `paramtype2` does not contain color\n information.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5275-L5279)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_node_drops","body":"get_node_drops(${1:node}, ${2:toolname})","desc":"`minetest.get_node_drops(node, toolname)`\n* Returns list of itemstrings that are dropped by `node` when dug\n with `toolname`.\n* `node`: node as table or node name\n* `toolname`: name of the tool item (can be `nil`)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5280-L5284)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_craft_result","body":"get_craft_result(${1:input})","desc":"`minetest.get_craft_result(input)`: returns `output, decremented_input`\n* `input.method` = `\"normal\"` or `\"cooking\"` or `\"fuel\"`\n* `input.width` = for example `3`\n* `input.items` = for example\n `{stack1, stack2, stack3, stack4, stack 5, stack 6, stack 7, stack 8, stack 9}`\n* `output.item` = `ItemStack`, if unsuccessful: empty `ItemStack`\n* `output.time` = a number, if unsuccessful: `0`\n* `output.replacements` = List of replacement `ItemStack`s that couldn't be\n placed in `decremented_input.items`. Replacements can be placed in\n `decremented_input` if the stack of the replaced item has a count of 1.\n* `decremented_input` = like `input`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5285-L5295)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_craft_recipe","body":"get_craft_recipe(${1:output})","desc":"`minetest.get_craft_recipe(output)`: returns input\n* returns last registered recipe for output item (node)\n* `output` is a node or item type such as `\"default:torch\"`\n* `input.method` = `\"normal\"` or `\"cooking\"` or `\"fuel\"`\n* `input.width` = for example `3`\n* `input.items` = for example\n `{stack1, stack2, stack3, stack4, stack 5, stack 6, stack 7, stack 8, stack 9}`\n * `input.items` = `nil` if no recipe found\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5296-L5303)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_all_craft_recipes","body":"get_all_craft_recipes(${1:query item})","desc":"`minetest.get_all_craft_recipes(query item)`: returns a table or `nil`\n* returns indexed table with all registered recipes for query item (node)\n or `nil` if no recipe was found.\n* recipe entry table:\n * `method`: 'normal' or 'cooking' or 'fuel'\n * `width`: 0-3, 0 means shapeless recipe\n * `items`: indexed [1-9] table with recipe items\n * `output`: string with item name and quantity\n* Example query for `\"default:gold_ingot\"` will return table:\n\n {\n [1]={method = \"cooking\", width = 3, output = \"default:gold_ingot\",\n items = {1 = \"default:gold_lump\"}},\n [2]={method = \"normal\", width = 1, output = \"default:gold_ingot 9\",\n items = {1 = \"default:goldblock\"}}\n }\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5304-L5319)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"handle_node_drops","body":"handle_node_drops(${1:pos}, ${2:drops}, ${3:digger})","desc":"`minetest.handle_node_drops(pos, drops, digger)`\n* `drops`: list of itemstrings\n* Handles drops from nodes after digging: Default action is to put them\n into digger's inventory.\n* Can be overridden to get different functionality (e.g. dropping items on\n ground)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5320-L5325)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"itemstring_with_palette","body":"itemstring_with_palette(${1:item}, ${2:palette_index})","desc":"`minetest.itemstring_with_palette(item, palette_index)`: returns an item\n string.\n* Creates an item string which contains palette index information\n for hardware colorization. You can use the returned string\n as an output in a craft recipe.\n* `item`: the item stack which becomes colored. Can be in string,\n table and native form.\n* `palette_index`: this index is added to the item stack\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5326-L5333)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"itemstring_with_color","body":"itemstring_with_color(${1:item}, ${2:colorstring})","desc":"`minetest.itemstring_with_color(item, colorstring)`: returns an item string\n* Creates an item string which contains static color information\n for hardware colorization. Use this method if you wish to colorize\n an item that does not own a palette. You can use the returned string\n as an output in a craft recipe.\n* `item`: the item stack which becomes colored. Can be in string,\n table and native form.\n* `colorstring`: the new color of the item stack\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5334-L5341)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"rollback_get_node_actions","body":"rollback_get_node_actions(${1:pos}, ${2:range}, ${3:seconds}, ${4:limit})","desc":"`minetest.rollback_get_node_actions(pos, range, seconds, limit)`:\n returns `{{actor, pos, time, oldnode, newnode}, ...}`\n* Find who has done something to a node, or near a node\n* `actor`: `\"player:<name>\"`, also `\"liquid\"`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5346-L5349)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"rollback_revert_actions_by","body":"rollback_revert_actions_by(${1:actor}, ${2:seconds})","desc":"`minetest.rollback_revert_actions_by(actor, seconds)`: returns\n `boolean, log_messages`.\n* Revert latest actions of someone\n* `actor`: `\"player:<name>\"`, also `\"liquid\"`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5350-L5353)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"item_place_node","body":"item_place_node(${1:itemstack}, ${2:placer}, ${3:pointed_thing}${4:[, param2}, ${5:prevent_after_place]})","desc":"`minetest.item_place_node(itemstack, placer, pointed_thing[, param2, prevent_after_place])`\n* Place item as a node\n* `param2` overrides `facedir` and wallmounted `param2`\n* `prevent_after_place`: if set to `true`, `after_place_node` is not called\n for the newly placed node to prevent a callback and placement loop\n* returns `itemstack, position`\n * `position`: the location the node was placed to. `nil` if nothing was placed.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5358-L5364)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"item_place_object","body":"item_place_object(${1:itemstack}, ${2:placer}, ${3:pointed_thing})","desc":"`minetest.item_place_object(itemstack, placer, pointed_thing)`\n* Place item as-is\n* returns the leftover itemstack\n* **Note**: This function is deprecated and will never be called.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5365-L5368)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"item_place","body":"item_place(${1:itemstack}, ${2:placer}, ${3:pointed_thing}${4:[, param2]})","desc":"`minetest.item_place(itemstack, placer, pointed_thing[, param2])`\n* Wrapper that calls `minetest.item_place_node` if appropriate\n* Calls `on_rightclick` of `pointed_thing.under` if defined instead\n* **Note**: is not called when wielded item overrides `on_place`\n* `param2` overrides facedir and wallmounted `param2`\n* returns `itemstack, position`\n * `position`: the location the node was placed to. `nil` if nothing was placed.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5369-L5375)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"item_drop","body":"item_drop(${1:itemstack}, ${2:dropper}, ${3:pos})","desc":"`minetest.item_drop(itemstack, dropper, pos)`\n* Drop the item\n* returns the leftover itemstack\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5376-L5378)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"item_eat","body":"item_eat(${1:hp_change}${2:[, replace_with_item]})","desc":"`minetest.item_eat(hp_change[, replace_with_item])`\n* Returns `function(itemstack, user, pointed_thing)` as a\n function wrapper for `minetest.do_item_eat`.\n* `replace_with_item` is the itemstring which is added to the inventory.\n If the player is eating a stack, then replace_with_item goes to a\n different spot.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5379-L5384)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"node_punch","body":"node_punch(${1:pos}, ${2:node}, ${3:puncher}, ${4:pointed_thing})","desc":"`minetest.node_punch(pos, node, puncher, pointed_thing)`\n* Calls functions registered by `minetest.register_on_punchnode()`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5389-L5390)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"node_dig","body":"node_dig(${1:pos}, ${2:node}, ${3:digger})","desc":"`minetest.node_dig(pos, node, digger)`\n* Checks if node can be dug, puts item into inventory, removes node\n* Calls functions registered by `minetest.registered_on_dignodes()`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5391-L5393)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"sound_play","body":"sound_play(${1:spec}, ${2:parameters}, [${3:ephemeral]})","desc":"`minetest.sound_play(spec, parameters, [ephemeral])`: returns a handle\n* `spec` is a `SimpleSoundSpec`\n* `parameters` is a sound parameter table\n* `ephemeral` is a boolean (default: false)\n Ephemeral sounds will not return a handle and can't be stopped or faded.\n It is recommend to use this for short sounds that happen in response to\n player actions (e.g. door closing).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5398-L5404)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"sound_stop","body":"sound_stop(${1:handle})","desc":"`minetest.sound_stop(handle)`\n* `handle` is a handle returned by `minetest.sound_play`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5405-L5406)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"sound_fade","body":"sound_fade(${1:handle}, ${2:step}, ${3:gain})","desc":"`minetest.sound_fade(handle, step, gain)`\n* `handle` is a handle returned by `minetest.sound_play`\n* `step` determines how fast a sound will fade.\n The gain will change by this much per second,\n until it reaches the target gain.\n Note: Older versions used a signed step. This is deprecated, but old\n code will still work. (the client uses abs(step) to correct it)\n* `gain` the target gain for the fade.\n Fading to zero will delete the sound.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5407-L5415)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"after","body":"after(${1:time}, ${2:func}, ${3:...})","desc":"`minetest.after(time, func, ...)` : returns job table to use as below.\n* Call the function `func` after `time` seconds, may be fractional\n* Optional: Variable number of arguments that are passed to `func`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5420-L5422)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"request_shutdown","body":"request_shutdown([${1:message]},[${2:reconnect]},[${3:delay]})","desc":"`minetest.request_shutdown([message],[reconnect],[delay])`: request for\n server shutdown. Will display `message` to clients.\n* `reconnect` == true displays a reconnect button\n* `delay` adds an optional delay (in seconds) before shutdown.\n Negative delay cancels the current active shutdown.\n Zero delay triggers an immediate shutdown.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5430-L5435)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"cancel_shutdown_requests","body":"cancel_shutdown_requests()","desc":"`minetest.cancel_shutdown_requests()`: cancel current delayed shutdown\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5436-L5436)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_server_status","body":"get_server_status(${1:name}, ${2:joined})","desc":"`minetest.get_server_status(name, joined)`\n* Returns the server status string when a player joins or when the command\n `/status` is called. Returns `nil` or an empty string when the message is\n disabled.\n* `joined`: Boolean value, indicates whether the function was called when\n a player joined.\n* This function may be overwritten by mods to customize the status message.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5437-L5443)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_server_uptime","body":"get_server_uptime()","desc":"`minetest.get_server_uptime()`: returns the server uptime in seconds\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5444-L5444)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"remove_player","body":"remove_player(${1:name})","desc":"`minetest.remove_player(name)`: remove player from database (if they are not\n connected).\n* As auth data is not removed, minetest.player_exists will continue to\n return true. Call the below method as well if you want to remove auth\n data too.\n* Returns a code (0: successful, 1: no such player, 2: player is connected)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5445-L5450)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"remove_player_auth","body":"remove_player_auth(${1:name})","desc":"`minetest.remove_player_auth(name)`: remove player authentication data\n* Returns boolean indicating success (false if player nonexistant)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5451-L5452)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"dynamic_add_media","body":"dynamic_add_media(${1:filepath}, ${2:callback})","desc":"`minetest.dynamic_add_media(filepath, callback)`\n* `filepath`: path to a media file on the filesystem\n* `callback`: function with arguments `name`, where name is a player name\n (previously there was no callback argument; omitting it is deprecated)\n* Adds the file to the media sent to clients by the server on startup\n and also pushes this file to already connected clients.\n The file must be a supported image, sound or model format. It must not be\n modified, deleted, moved or renamed after calling this function.\n The list of dynamically added media is not persisted.\n* Returns false on error, true if the request was accepted\n* The given callback will be called for every player as soon as the\n media is available on the client.\n Old clients that lack support for this feature will not see the media\n unless they reconnect to the server. (callback won't be called)\n* Since media transferred this way currently does not use client caching\n or HTTP transfers, dynamic media should not be used with big files.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5453-L5468)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_ban_list","body":"get_ban_list()","desc":"`minetest.get_ban_list()`: returns a list of all bans formatted as string\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5473-L5473)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_ban_description","body":"get_ban_description(${1:ip_or_name})","desc":"`minetest.get_ban_description(ip_or_name)`: returns list of bans matching\n IP address or name formatted as string\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5474-L5475)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"ban_player","body":"ban_player(${1:name})","desc":"`minetest.ban_player(name)`: ban the IP of a currently connected player\n* Returns boolean indicating success\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5476-L5477)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"unban_player_or_ip","body":"unban_player_or_ip(${1:ip_or_name})","desc":"`minetest.unban_player_or_ip(ip_or_name)`: remove ban record matching\n IP address or name\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5478-L5479)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"kick_player","body":"kick_player(${1:name}, [${2:reason]})","desc":"`minetest.kick_player(name, [reason])`: disconnect a player with an optional\n reason.\n* Returns boolean indicating success (false if player nonexistant)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5480-L5482)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"add_particle","body":"add_particle(${1:particle definition})","desc":"`minetest.add_particle(particle definition)`\n* Deprecated: `minetest.add_particle(pos, velocity, acceleration,\n expirationtime, size, collisiondetection, texture, playername)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5487-L5489)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"add_particlespawner","body":"add_particlespawner(${1:particlespawner definition})","desc":"`minetest.add_particlespawner(particlespawner definition)`\n* Add a `ParticleSpawner`, an object that spawns an amount of particles\n over `time` seconds.\n* Returns an `id`, and -1 if adding didn't succeed\n* Deprecated: `minetest.add_particlespawner(amount, time,\n minpos, maxpos,\n minvel, maxvel,\n minacc, maxacc,\n minexptime, maxexptime,\n minsize, maxsize,\n collisiondetection, texture, playername)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5491-L5501)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"delete_particlespawner","body":"delete_particlespawner(${1:id}, ${2:player})","desc":"`minetest.delete_particlespawner(id, player)`\n* Delete `ParticleSpawner` with `id` (return value from\n `minetest.add_particlespawner`).\n* If playername is specified, only deletes on the player's client,\n otherwise on all clients.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5503-L5507)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"create_schematic","body":"create_schematic(${1:p1}, ${2:p2}, ${3:probability_list}, ${4:filename}, ${5:slice_prob_list})","desc":"`minetest.create_schematic(p1, p2, probability_list, filename, slice_prob_list)`\n* Create a schematic from the volume of map specified by the box formed by\n p1 and p2.\n* Apply the specified probability and per-node force-place to the specified\n nodes according to the `probability_list`.\n * `probability_list` is an array of tables containing two fields, `pos`\n and `prob`.\n * `pos` is the 3D vector specifying the absolute coordinates of the\n node being modified,\n * `prob` is an integer value from `0` to `255` that encodes\n probability and per-node force-place. Probability has levels\n 0-127, then 128 may be added to encode per-node force-place.\n For probability stated as 0-255, divide by 2 and round down to\n get values 0-127, then add 128 to apply per-node force-place.\n * If there are two or more entries with the same pos value, the\n last entry is used.\n * If `pos` is not inside the box formed by `p1` and `p2`, it is\n ignored.\n * If `probability_list` equals `nil`, no probabilities are applied.\n* Apply the specified probability to the specified horizontal slices\n according to the `slice_prob_list`.\n * `slice_prob_list` is an array of tables containing two fields, `ypos`\n and `prob`.\n * `ypos` indicates the y position of the slice with a probability\n applied, the lowest slice being `ypos = 0`.\n * If slice probability list equals `nil`, no slice probabilities\n are applied.\n* Saves schematic in the Minetest Schematic format to filename.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5512-L5539)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"place_schematic","body":"place_schematic(${1:pos}, ${2:schematic}, ${3:rotation}, ${4:replacements}, ${5:force_placement}, ${6:flags})","desc":"`minetest.place_schematic(pos, schematic, rotation, replacements, force_placement, flags)`\n* Place the schematic specified by schematic (see [Schematic specifier]) at\n `pos`.\n* `rotation` can equal `\"0\"`, `\"90\"`, `\"180\"`, `\"270\"`, or `\"random\"`.\n* If the `rotation` parameter is omitted, the schematic is not rotated.\n* `replacements` = `{[\"old_name\"] = \"convert_to\", ...}`\n* `force_placement` is a boolean indicating whether nodes other than `air`\n and `ignore` are replaced by the schematic.\n* Returns nil if the schematic could not be loaded.\n* **Warning**: Once you have loaded a schematic from a file, it will be\n cached. Future calls will always use the cached version and the\n replacement list defined for it, regardless of whether the file or the\n replacement list parameter have changed. The only way to load the file\n anew is to restart the server.\n* `flags` is a flag field with the available flags:\n * place_center_x\n * place_center_y\n * place_center_z\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5541-L5558)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"place_schematic_on_vmanip","body":"place_schematic_on_vmanip(${1:vmanip}, ${2:pos}, ${3:schematic}, ${4:rotation}, ${5:replacement}, ${6:force_placement}, ${7:flags})","desc":"`minetest.place_schematic_on_vmanip(vmanip, pos, schematic, rotation, replacement, force_placement, flags)`:\n* This function is analogous to minetest.place_schematic, but places a\n schematic onto the specified VoxelManip object `vmanip` instead of the\n map.\n* Returns false if any part of the schematic was cut-off due to the\n VoxelManip not containing the full area required, and true if the whole\n schematic was able to fit.\n* Returns nil if the schematic could not be loaded.\n* After execution, any external copies of the VoxelManip contents are\n invalidated.\n* `flags` is a flag field with the available flags:\n * place_center_x\n * place_center_y\n * place_center_z\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5560-L5573)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"serialize_schematic","body":"serialize_schematic(${1:schematic}, ${2:format}, ${3:options})","desc":"`minetest.serialize_schematic(schematic, format, options)`\n* Return the serialized schematic specified by schematic\n (see [Schematic specifier])\n* in the `format` of either \"mts\" or \"lua\".\n* \"mts\" - a string containing the binary MTS data used in the MTS file\n format.\n* \"lua\" - a string containing Lua code representing the schematic in table\n format.\n* `options` is a table containing the following optional parameters:\n * If `lua_use_comments` is true and `format` is \"lua\", the Lua code\n generated will have (X, Z) position comments for every X row\n generated in the schematic data for easier reading.\n * If `lua_num_indent_spaces` is a nonzero number and `format` is \"lua\",\n the Lua code generated will use that number of spaces as indentation\n instead of a tab character.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5575-L5589)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"read_schematic","body":"read_schematic(${1:schematic}, ${2:options})","desc":"`minetest.read_schematic(schematic, options)`\n* Returns a Lua table representing the schematic (see: [Schematic specifier])\n* `schematic` is the schematic to read (see: [Schematic specifier])\n* `options` is a table containing the following optional parameters:\n * `write_yslice_prob`: string value:\n * `none`: no `write_yslice_prob` table is inserted,\n * `low`: only probabilities that are not 254 or 255 are written in\n the `write_ylisce_prob` table,\n * `all`: write all probabilities to the `write_yslice_prob` table.\n * The default for this option is `all`.\n * Any invalid value will be interpreted as `all`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5591-L5601)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"request_http_api","body":"request_http_api()","desc":"`minetest.request_http_api()`:\n* returns `HTTPApiTable` containing http functions if the calling mod has\n been granted access by being listed in the `secure.http_mods` or\n `secure.trusted_mods` setting, otherwise returns `nil`.\n* The returned table contains the functions `fetch`, `fetch_async` and\n `fetch_async_get` described below.\n* Only works at init time and must be called from the mod's main scope\n (not from a function).\n* Function only exists if minetest server was built with cURL support.\n* **DO NOT ALLOW ANY OTHER MODS TO ACCESS THE RETURNED TABLE, STORE IT IN\n A LOCAL VARIABLE!**\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5606-L5616)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"fetch","body":"fetch(${1:HTTPRequest req}, ${2:callback})","desc":"`HTTPApiTable.fetch(HTTPRequest req, callback)`\n* Performs given request asynchronously and calls callback upon completion\n* callback: `function(HTTPRequestResult res)`\n* Use this HTTP function if you are unsure, the others are for advanced use\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5617-L5620)","kind":2,"detail":"Function","token":"."},{"prefix":"fetch_async","body":"fetch_async(${1:HTTPRequest req})","desc":"`HTTPApiTable.fetch_async(HTTPRequest req)`: returns handle\n* Performs given request asynchronously and returns handle for\n `HTTPApiTable.fetch_async_get`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5621-L5623)","kind":2,"detail":"Function","token":"."},{"prefix":"fetch_async_get","body":"fetch_async_get(${1:handle})","desc":"`HTTPApiTable.fetch_async_get(handle)`: returns HTTPRequestResult\n* Return response data for given asynchronous HTTP request\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5624-L5625)","kind":2,"detail":"Function","token":"."},{"prefix":"get_mod_storage","body":"get_mod_storage()","desc":"`minetest.get_mod_storage()`:\n* returns reference to mod private `StorageRef`\n* must be called during mod load time\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5630-L5632)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_connected_players","body":"get_connected_players()","desc":"`minetest.get_connected_players()`: returns list of `ObjectRefs`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5637-L5637)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"is_player","body":"is_player(${1:obj})","desc":"`minetest.is_player(obj)`: boolean, whether `obj` is a player\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5638-L5638)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"player_exists","body":"player_exists(${1:name})","desc":"`minetest.player_exists(name)`: boolean, whether player exists\n (regardless of online status)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5639-L5640)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"hud_replace_builtin","body":"hud_replace_builtin(${1:name}, ${2:hud_definition})","desc":"`minetest.hud_replace_builtin(name, hud_definition)`\n* Replaces definition of a builtin hud element\n* `name`: `\"breath\"` or `\"health\"`\n* `hud_definition`: definition to replace builtin definition\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5641-L5644)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"send_join_message","body":"send_join_message(${1:player_name})","desc":"`minetest.send_join_message(player_name)`\n* This function can be overridden by mods to change the join message.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5645-L5646)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"send_leave_message","body":"send_leave_message(${1:player_name}, ${2:timed_out})","desc":"`minetest.send_leave_message(player_name, timed_out)`\n* This function can be overridden by mods to change the leave message.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5647-L5648)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"hash_node_position","body":"hash_node_position(${1:pos})","desc":"`minetest.hash_node_position(pos)`: returns an 48-bit integer\n* `pos`: table {x=number, y=number, z=number},\n* Gives a unique hash number for a node position (16+16+16=48bit)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5649-L5651)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_position_from_hash","body":"get_position_from_hash(${1:hash})","desc":"`minetest.get_position_from_hash(hash)`: returns a position\n* Inverse transform of `minetest.hash_node_position`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5652-L5653)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_item_group","body":"get_item_group(${1:name}, ${2:group})","desc":"`minetest.get_item_group(name, group)`: returns a rating\n* Get rating of a group of an item. (`0` means: not in group)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5654-L5655)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_node_group","body":"get_node_group(${1:name}, ${2:group})","desc":"`minetest.get_node_group(name, group)`: returns a rating\n* Deprecated: An alias for the former.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5656-L5657)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"raillike_group","body":"raillike_group(${1:name})","desc":"`minetest.raillike_group(name)`: returns a rating\n* Returns rating of the connect_to_raillike group corresponding to name\n* If name is not yet the name of a connect_to_raillike group, a new group\n id is created, with that name.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5658-L5661)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_content_id","body":"get_content_id(${1:name})","desc":"`minetest.get_content_id(name)`: returns an integer\n* Gets the internal content ID of `name`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5662-L5663)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_name_from_content_id","body":"get_name_from_content_id(${1:content_id})","desc":"`minetest.get_name_from_content_id(content_id)`: returns a string\n* Gets the name of the content with that content ID\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5664-L5665)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"parse_json","body":"parse_json(${1:string}${2:[, nullvalue]})","desc":"`minetest.parse_json(string[, nullvalue])`: returns something\n* Convert a string containing JSON data into the Lua equivalent\n* `nullvalue`: returned in place of the JSON null; defaults to `nil`\n* On success returns a table, a string, a number, a boolean or `nullvalue`\n* On failure outputs an error message and returns `nil`\n* Example: `parse_json(\"[10, {\\\"a\\\":false}]\")`, returns `{10, {a = false}}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5666-L5671)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"write_json","body":"write_json(${1:data}${2:[, styled]})","desc":"`minetest.write_json(data[, styled])`: returns a string or `nil` and an error\n message.\n* Convert a Lua table into a JSON string\n* styled: Outputs in a human-readable format if this is set, defaults to\n false.\n* Unserializable things like functions and userdata will cause an error.\n* **Warning**: JSON is more strict than the Lua table format.\n 1. You can only use strings and positive integers of at least one as\n keys.\n 2. You can not mix string and integer keys.\n This is due to the fact that JSON has two distinct array and object\n values.\n* Example: `write_json({10, {a = false}})`,\n returns `\"[10, {\\\"a\\\": false}]\"`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5672-L5685)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"serialize","body":"serialize(${1:table})","desc":"`minetest.serialize(table)`: returns a string\n* Convert a table containing tables, strings, numbers, booleans and `nil`s\n into string form readable by `minetest.deserialize`\n* Example: `serialize({foo='bar'})`, returns `'return { [\"foo\"] = \"bar\" }'`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5686-L5689)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"deserialize","body":"deserialize(${1:string}${2:[, safe]})","desc":"`minetest.deserialize(string[, safe])`: returns a table\n* Convert a string returned by `minetest.serialize` into a table\n* `string` is loaded in an empty sandbox environment.\n* Will load functions if safe is false or omitted. Although these functions\n cannot directly access the global environment, they could bypass this\n restriction with maliciously crafted Lua bytecode if mod security is\n disabled.\n* This function should not be used on untrusted data, regardless of the\n value of `safe`. It is fine to serialize then deserialize user-provided\n data, but directly providing user input to deserialize is always unsafe.\n* Example: `deserialize('return { [\"foo\"] = \"bar\" }')`,\n returns `{foo='bar'}`\n* Example: `deserialize('print(\"foo\")')`, returns `nil`\n (function call fails), returns\n `error:[string \"print(\"foo\")\"]:1: attempt to call global 'print' (a nil value)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5690-L5704)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"compress","body":"compress(${1:data}, ${2:method}, ${3:...})","desc":"`minetest.compress(data, method, ...)`: returns `compressed_data`\n* Compress a string of data.\n* `method` is a string identifying the compression method to be used.\n* Supported compression methods:\n * Deflate (zlib): `\"deflate\"`\n* `...` indicates method-specific arguments. Currently defined arguments\n are:\n * Deflate: `level` - Compression level, `0`-`9` or `nil`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5705-L5712)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"decompress","body":"decompress(${1:compressed_data}, ${2:method}, ${3:...})","desc":"`minetest.decompress(compressed_data, method, ...)`: returns data\n* Decompress a string of data (using ZLib).\n* See documentation on `minetest.compress()` for supported compression\n methods.\n* `...` indicates method-specific arguments. Currently, no methods use this\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5713-L5717)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"rgba","body":"rgba(${1:red}, ${2:green}, ${3:blue}${4:[, alpha]})","desc":"`minetest.rgba(red, green, blue[, alpha])`: returns a string\n* Each argument is a 8 Bit unsigned integer\n* Returns the ColorString from rgb or rgba values\n* Example: `minetest.rgba(10, 20, 30, 40)`, returns `\"#0A141E28\"`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5718-L5721)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"encode_base64","body":"encode_base64(${1:string})","desc":"`minetest.encode_base64(string)`: returns string encoded in base64\n* Encodes a string in base64.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5722-L5723)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"decode_base64","body":"decode_base64(${1:string})","desc":"`minetest.decode_base64(string)`: returns string or nil for invalid base64\n* Decodes a string encoded in base64.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5724-L5725)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"is_protected","body":"is_protected(${1:pos}, ${2:name})","desc":"`minetest.is_protected(pos, name)`: returns boolean\n* Returning `true` restricts the player `name` from modifying (i.e. digging,\n placing) the node at position `pos`.\n* `name` will be `\"\"` for non-players or unknown players.\n* This function should be overridden by protection mods. It is highly\n recommended to grant access to players with the `protection_bypass` privilege.\n* Cache and call the old version of this function if the position is\n not protected by the mod. This will allow using multiple protection mods.\n* Example:\n\n local old_is_protected = minetest.is_protected\n function minetest.is_protected(pos, name)\n if mymod:position_protected_from(pos, name) then\n return true\n end\n return old_is_protected(pos, name)\n end\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5726-L5742)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"record_protection_violation","body":"record_protection_violation(${1:pos}, ${2:name})","desc":"`minetest.record_protection_violation(pos, name)`\n* This function calls functions registered with\n `minetest.register_on_protection_violation`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5743-L5745)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"is_creative_enabled","body":"is_creative_enabled(${1:name})","desc":"`minetest.is_creative_enabled(name)`: returns boolean\n* Returning `true` means that Creative Mode is enabled for player `name`.\n* `name` will be `\"\"` for non-players or if the player is unknown.\n* This function should be overridden by Creative Mode-related mods to\n implement a per-player Creative Mode.\n* By default, this function returns `true` if the setting\n `creative_mode` is `true` and `false` otherwise.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5746-L5752)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"is_area_protected","body":"is_area_protected(${1:pos1}, ${2:pos2}, ${3:player_name}, ${4:interval})","desc":"`minetest.is_area_protected(pos1, pos2, player_name, interval)`\n* Returns the position of the first node that `player_name` may not modify\n in the specified cuboid between `pos1` and `pos2`.\n* Returns `false` if no protections were found.\n* Applies `is_protected()` to a 3D lattice of points in the defined volume.\n The points are spaced evenly throughout the volume and have a spacing\n similar to, but no larger than, `interval`.\n* All corners and edges of the defined volume are checked.\n* `interval` defaults to 4.\n* `interval` should be carefully chosen and maximised to avoid an excessive\n number of points being checked.\n* Like `minetest.is_protected`, this function may be extended or\n overwritten by mods to provide a faster implementation to check the\n cuboid for intersections.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5753-L5766)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"rotate_and_place","body":"rotate_and_place(itemstack, placer, pointed_thing[, infinitestacks,","desc":"`minetest.rotate_and_place(itemstack, placer, pointed_thing[, infinitestacks,\n orient_flags, prevent_after_place])`\n* Attempt to predict the desired orientation of the facedir-capable node\n defined by `itemstack`, and place it accordingly (on-wall, on the floor,\n or hanging from the ceiling).\n* `infinitestacks`: if `true`, the itemstack is not changed. Otherwise the\n stacks are handled normally.\n* `orient_flags`: Optional table containing extra tweaks to the placement code:\n * `invert_wall`: if `true`, place wall-orientation on the ground and\n ground-orientation on the wall.\n * `force_wall` : if `true`, always place the node in wall orientation.\n * `force_ceiling`: if `true`, always place on the ceiling.\n * `force_floor`: if `true`, always place the node on the floor.\n * `force_facedir`: if `true`, forcefully reset the facedir to north\n when placing on the floor or ceiling.\n * The first four options are mutually-exclusive; the last in the list\n takes precedence over the first.\n* `prevent_after_place` is directly passed to `minetest.item_place_node`\n* Returns the new itemstack after placement\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5767-L5785)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"rotate_node","body":"rotate_node(${1:itemstack}, ${2:placer}, ${3:pointed_thing})","desc":"`minetest.rotate_node(itemstack, placer, pointed_thing)`\n* calls `rotate_and_place()` with `infinitestacks` set according to the state\n of the creative mode setting, checks for \"sneak\" to set the `invert_wall`\n parameter and `prevent_after_place` set to `true`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5786-L5789)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"calculate_knockback","body":"calculate_knockback(player, hitter, time_from_last_punch,","desc":"`minetest.calculate_knockback(player, hitter, time_from_last_punch,\n tool_capabilities, dir, distance, damage)`\n* Returns the amount of knockback applied on the punched player.\n* Arguments are equivalent to `register_on_punchplayer`, except the following:\n * `distance`: distance between puncher and punched player\n* This function can be overriden by mods that wish to modify this behaviour.\n* You may want to cache and call the old function to allow multiple mods to\n change knockback behaviour.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5791-L5798)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"forceload_block","body":"forceload_block(${1:pos}${2:[, transient]})","desc":"`minetest.forceload_block(pos[, transient])`\n* forceloads the position `pos`.\n* returns `true` if area could be forceloaded\n* If `transient` is `false` or absent, the forceload will be persistent\n (saved between server runs). If `true`, the forceload will be transient\n (not saved between server runs).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5800-L5805)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"forceload_free_block","body":"forceload_free_block(${1:pos}${2:[, transient]})","desc":"`minetest.forceload_free_block(pos[, transient])`\n* stops forceloading the position `pos`\n* If `transient` is `false` or absent, frees a persistent forceload.\n If `true`, frees a transient forceload.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5807-L5810)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"request_insecure_environment","body":"request_insecure_environment()","desc":"`minetest.request_insecure_environment()`: returns an environment containing\n insecure functions if the calling mod has been listed as trusted in the\n `secure.trusted_mods` setting or security is disabled, otherwise returns\n `nil`.\n* Only works at init time and must be called from the mod's main scope\n (ie: the init.lua of the mod, not from another Lua file or within a function).\n* **DO NOT ALLOW ANY OTHER MODS TO ACCESS THE RETURNED ENVIRONMENT, STORE\n IT IN A LOCAL VARIABLE!**\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5812-L5819)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"global_exists","body":"global_exists(${1:name})","desc":"`minetest.global_exists(name)`\n* Checks if a global variable has been set, without triggering a warning.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5821-L5822)","kind":2,"detail":"Function","token":"minetest."},{"prefix":"get_area","body":"get_area(${1:id}, ${2:include_borders}, ${3:include_data})","desc":"`get_area(id, include_borders, include_data)`\n* Returns the area information about the specified ID.\n* Returned values are either of these:\n\n nil -- Area not found\n true -- Without `include_borders` and `include_data`\n {\n min = pos, max = pos -- `include_borders == true`\n data = string -- `include_data == true`\n }\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5909-L5918)","kind":1,"detail":"Method","token":":"},{"prefix":"get_areas_for_pos","body":"get_areas_for_pos(${1:pos}, ${2:include_borders}, ${3:include_data})","desc":"`get_areas_for_pos(pos, include_borders, include_data)`\n* Returns all areas as table, indexed by the area ID.\n* Table values: see `get_area`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5920-L5922)","kind":1,"detail":"Method","token":":"},{"prefix":"get_areas_in_area","body":"get_areas_in_area(${1:edge1}, ${2:edge2}, ${3:accept_overlap}, ${4:include_borders}, ${5:include_data})","desc":"`get_areas_in_area(edge1, edge2, accept_overlap, include_borders, include_data)`\n* Returns all areas that contain all nodes inside the area specified by `edge1`\n and `edge2` (inclusive).\n* `accept_overlap`: if `true`, areas are returned that have nodes in\n common (intersect) with the specified area.\n* Returns the same values as `get_areas_for_pos`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5923-L5928)","kind":1,"detail":"Method","token":":"},{"prefix":"insert_area","body":"insert_area(${1:edge1}, ${2:edge2}, ${3:data}, [${4:id]})","desc":"`insert_area(edge1, edge2, data, [id])`: inserts an area into the store.\n* Returns the new area's ID, or nil if the insertion failed.\n* The (inclusive) positions `edge1` and `edge2` describe the area.\n* `data` is a string stored with the area.\n* `id` (optional): will be used as the internal area ID if it is an unique\n number between 0 and 2^32-2.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5929-L5934)","kind":1,"detail":"Method","token":":"},{"prefix":"reserve","body":"reserve(${1:count})","desc":"`reserve(count)`: reserves resources for at most `count` many contained\n areas.\n Only needed for efficiency, and only some implementations profit.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5935-L5937)","kind":1,"detail":"Method","token":":"},{"prefix":"remove_area","body":"remove_area(${1:id})","desc":"`remove_area(id)`: removes the area with the given id from the store, returns\n success.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5938-L5939)","kind":1,"detail":"Method","token":":"},{"prefix":"set_cache_params","body":"set_cache_params(${1:params})","desc":"`set_cache_params(params)`: sets params for the included prefiltering cache.\n Calling invalidates the cache, so that its elements have to be newly\n generated.\n* `params` is a table with the following fields:\n\n enabled = boolean, -- Whether to enable, default true\n block_radius = int, -- The radius (in nodes) of the areas the cache\n -- generates prefiltered lists for, minimum 16,\n -- default 64\n limit = int, -- The cache size, minimum 20, default 1000\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5940-L5949)","kind":1,"detail":"Method","token":":"},{"prefix":"to_string","body":"to_string()","desc":"`to_string()`: Experimental. Returns area store serialized as a (binary)\n string.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5950-L5951)","kind":1,"detail":"Method","token":":"},{"prefix":"to_file","body":"to_file(${1:filename})","desc":"`to_file(filename)`: Experimental. Like `to_string()`, but writes the data to\n a file.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5952-L5953)","kind":1,"detail":"Method","token":":"},{"prefix":"from_string","body":"from_string(${1:str})","desc":"`from_string(str)`: Experimental. Deserializes string and loads it into the\n AreaStore.\n Returns success and, optionally, an error message.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5954-L5956)","kind":1,"detail":"Method","token":":"},{"prefix":"from_file","body":"from_file(${1:filename})","desc":"`from_file(filename)`: Experimental. Like `from_string()`, but reads the data\n from a file.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5957-L5958)","kind":1,"detail":"Method","token":":"},{"prefix":"is_empty","body":"is_empty(${1:listname})","desc":"`is_empty(listname)`: return `true` if list is empty\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5967-L5967)","kind":1,"detail":"Method","token":":"},{"prefix":"get_size","body":"get_size(${1:listname})","desc":"`get_size(listname)`: get size of a list\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5968-L5968)","kind":1,"detail":"Method","token":":"},{"prefix":"set_size","body":"set_size(${1:listname}, ${2:size})","desc":"`set_size(listname, size)`: set size of a list\n* returns `false` on error (e.g. invalid `listname` or `size`)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5969-L5970)","kind":1,"detail":"Method","token":":"},{"prefix":"get_width","body":"get_width(${1:listname})","desc":"`get_width(listname)`: get width of a list\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5971-L5971)","kind":1,"detail":"Method","token":":"},{"prefix":"set_width","body":"set_width(${1:listname}, ${2:width})","desc":"`set_width(listname, width)`: set width of list; currently used for crafting\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5972-L5972)","kind":1,"detail":"Method","token":":"},{"prefix":"get_stack","body":"get_stack(${1:listname}, ${2:i})","desc":"`get_stack(listname, i)`: get a copy of stack index `i` in list\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5973-L5973)","kind":1,"detail":"Method","token":":"},{"prefix":"set_stack","body":"set_stack(${1:listname}, ${2:i}, ${3:stack})","desc":"`set_stack(listname, i, stack)`: copy `stack` to index `i` in list\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5974-L5974)","kind":1,"detail":"Method","token":":"},{"prefix":"get_list","body":"get_list(${1:listname})","desc":"`get_list(listname)`: return full list\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5975-L5975)","kind":1,"detail":"Method","token":":"},{"prefix":"set_list","body":"set_list(${1:listname}, ${2:list})","desc":"`set_list(listname, list)`: set full list (size will not change)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5976-L5976)","kind":1,"detail":"Method","token":":"},{"prefix":"get_lists","body":"get_lists()","desc":"`get_lists()`: returns list of inventory lists\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5977-L5977)","kind":1,"detail":"Method","token":":"},{"prefix":"set_lists","body":"set_lists(${1:lists})","desc":"`set_lists(lists)`: sets inventory lists (size will not change)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5978-L5978)","kind":1,"detail":"Method","token":":"},{"prefix":"add_item","body":"add_item(${1:listname}, ${2:stack})","desc":"`add_item(listname, stack)`: add item somewhere in list, returns leftover\n `ItemStack`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5979-L5980)","kind":1,"detail":"Method","token":":"},{"prefix":"room_for_item","body":"room_for_item(${1:listname}, ${2:stack})","desc":"`room_for_item(listname, stack):` returns `true` if the stack of items\n can be fully added to the list\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5981-L5982)","kind":1,"detail":"Method","token":":"},{"prefix":"contains_item","body":"contains_item(${1:listname}, ${2:stack}, [${3:match_meta]})","desc":"`contains_item(listname, stack, [match_meta])`: returns `true` if\n the stack of items can be fully taken from the list.\n If `match_meta` is false, only the items' names are compared\n (default: `false`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5983-L5986)","kind":1,"detail":"Method","token":":"},{"prefix":"remove_item","body":"remove_item(${1:listname}, ${2:stack})","desc":"`remove_item(listname, stack)`: take as many items as specified from the\n list, returns the items that were actually removed (as an `ItemStack`)\n -- note that any item metadata is ignored, so attempting to remove a specific\n unique item this way will likely remove the wrong one -- to do that use\n `set_stack` with an empty `ItemStack`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5987-L5991)","kind":1,"detail":"Method","token":":"},{"prefix":"get_location","body":"get_location()","desc":"`get_location()`: returns a location compatible to\n `minetest.get_inventory(location)`.\n* returns `{type=\"undefined\"}` in case location is not known\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5992-L5994)","kind":1,"detail":"Method","token":":"},{"prefix":"is_empty","body":"is_empty()","desc":"`is_empty()`: returns `true` if stack is empty.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6031-L6031)","kind":1,"detail":"Method","token":":"},{"prefix":"get_name","body":"get_name()","desc":"`get_name()`: returns item name (e.g. `\"default:stone\"`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6032-L6032)","kind":1,"detail":"Method","token":":"},{"prefix":"set_name","body":"set_name(${1:item_name})","desc":"`set_name(item_name)`: returns a boolean indicating whether the item was\n cleared.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6033-L6034)","kind":1,"detail":"Method","token":":"},{"prefix":"get_count","body":"get_count()","desc":"`get_count()`: Returns number of items on the stack.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6035-L6035)","kind":1,"detail":"Method","token":":"},{"prefix":"set_count","body":"set_count(${1:count})","desc":"`set_count(count)`: returns a boolean indicating whether the item was cleared\n* `count`: number, unsigned 16 bit integer\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6036-L6037)","kind":1,"detail":"Method","token":":"},{"prefix":"get_wear","body":"get_wear()","desc":"`get_wear()`: returns tool wear (`0`-`65535`), `0` for non-tools.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6038-L6038)","kind":1,"detail":"Method","token":":"},{"prefix":"set_wear","body":"set_wear(${1:wear})","desc":"`set_wear(wear)`: returns boolean indicating whether item was cleared\n* `wear`: number, unsigned 16 bit integer\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6039-L6040)","kind":1,"detail":"Method","token":":"},{"prefix":"get_meta","body":"get_meta()","desc":"`get_meta()`: returns ItemStackMetaRef. See section for more details\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6041-L6041)","kind":1,"detail":"Method","token":":"},{"prefix":"get_metadata","body":"get_metadata()","desc":"`get_metadata()`: (DEPRECATED) Returns metadata (a string attached to an item\n stack).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6042-L6043)","kind":1,"detail":"Method","token":":"},{"prefix":"set_metadata","body":"set_metadata(${1:metadata})","desc":"`set_metadata(metadata)`: (DEPRECATED) Returns true.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6044-L6044)","kind":1,"detail":"Method","token":":"},{"prefix":"get_description","body":"get_description()","desc":"`get_description()`: returns the description shown in inventory list tooltips.\n* The engine uses this when showing item descriptions in tooltips.\n* Fields for finding the description, in order:\n * `description` in item metadata (See [Item Metadata].)\n * `description` in item definition\n * item name\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6045-L6050)","kind":1,"detail":"Method","token":":"},{"prefix":"get_short_description","body":"get_short_description()","desc":"`get_short_description()`: returns the short description or nil.\n* Unlike the description, this does not include new lines.\n* Fields for finding the short description, in order:\n * `short_description` in item metadata (See [Item Metadata].)\n * `short_description` in item definition\n * first line of the description (From item meta or def, see `get_description()`.)\n * Returns nil if none of the above are set\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6051-L6057)","kind":1,"detail":"Method","token":":"},{"prefix":"clear","body":"clear()","desc":"`clear()`: removes all items from the stack, making it empty.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6058-L6058)","kind":1,"detail":"Method","token":":"},{"prefix":"replace","body":"replace(${1:item})","desc":"`replace(item)`: replace the contents of this stack.\n* `item` can also be an itemstring or table.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6059-L6060)","kind":1,"detail":"Method","token":":"},{"prefix":"to_string","body":"to_string()","desc":"`to_string()`: returns the stack in itemstring form.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6061-L6061)","kind":1,"detail":"Method","token":":"},{"prefix":"to_table","body":"to_table()","desc":"`to_table()`: returns the stack in Lua table form.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6062-L6062)","kind":1,"detail":"Method","token":":"},{"prefix":"get_stack_max","body":"get_stack_max()","desc":"`get_stack_max()`: returns the maximum size of the stack (depends on the\n item).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6063-L6064)","kind":1,"detail":"Method","token":":"},{"prefix":"get_free_space","body":"get_free_space()","desc":"`get_free_space()`: returns `get_stack_max() - get_count()`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6065-L6065)","kind":1,"detail":"Method","token":":"},{"prefix":"is_known","body":"is_known()","desc":"`is_known()`: returns `true` if the item name refers to a defined item type.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6066-L6066)","kind":1,"detail":"Method","token":":"},{"prefix":"get_definition","body":"get_definition()","desc":"`get_definition()`: returns the item definition table.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6067-L6067)","kind":1,"detail":"Method","token":":"},{"prefix":"get_tool_capabilities","body":"get_tool_capabilities()","desc":"`get_tool_capabilities()`: returns the digging properties of the item,\n or those of the hand if none are defined for this item type\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6068-L6069)","kind":1,"detail":"Method","token":":"},{"prefix":"add_wear","body":"add_wear(${1:amount})","desc":"`add_wear(amount)`\n* Increases wear by `amount` if the item is a tool\n* `amount`: number, integer\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6070-L6072)","kind":1,"detail":"Method","token":":"},{"prefix":"add_item","body":"add_item(${1:item})","desc":"`add_item(item)`: returns leftover `ItemStack`\n* Put some item or stack onto this stack\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6073-L6074)","kind":1,"detail":"Method","token":":"},{"prefix":"item_fits","body":"item_fits(${1:item})","desc":"`item_fits(item)`: returns `true` if item or stack can be fully added to\n this one.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6075-L6076)","kind":1,"detail":"Method","token":":"},{"prefix":"take_item","body":"take_item(${1:n})","desc":"`take_item(n)`: returns taken `ItemStack`\n* Take (and remove) up to `n` items from this stack\n* `n`: number, default: `1`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6077-L6079)","kind":1,"detail":"Method","token":":"},{"prefix":"peek_item","body":"peek_item(${1:n})","desc":"`peek_item(n)`: returns taken `ItemStack`\n* Copy (don't remove) up to `n` items from this stack\n* `n`: number, default: `1`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6080-L6082)","kind":1,"detail":"Method","token":":"},{"prefix":"set_tool_capabilities","body":"set_tool_capabilities([${1:tool_capabilities]})","desc":"`set_tool_capabilities([tool_capabilities])`\n* Overrides the item's tool capabilities\n* A nil value will clear the override data and restore the original\n behavior.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6093-L6096)","kind":1,"detail":"Method","token":":"},{"prefix":"contains","body":"contains(${1:key})","desc":"`contains(key)`: Returns true if key present, otherwise false.\n* Returns `nil` when the MetaData is inexistent.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6106-L6107)","kind":1,"detail":"Method","token":":"},{"prefix":"get","body":"get(${1:key})","desc":"`get(key)`: Returns `nil` if key not present, else the stored string.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6108-L6108)","kind":1,"detail":"Method","token":":"},{"prefix":"set_string","body":"set_string(${1:key}, ${2:value})","desc":"`set_string(key, value)`: Value of `\"\"` will delete the key.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6109-L6109)","kind":1,"detail":"Method","token":":"},{"prefix":"get_string","body":"get_string(${1:key})","desc":"`get_string(key)`: Returns `\"\"` if key not present.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6110-L6110)","kind":1,"detail":"Method","token":":"},{"prefix":"set_int","body":"set_int(${1:key}, ${2:value})","desc":"`set_int(key, value)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6111-L6111)","kind":1,"detail":"Method","token":":"},{"prefix":"get_int","body":"get_int(${1:key})","desc":"`get_int(key)`: Returns `0` if key not present.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6112-L6112)","kind":1,"detail":"Method","token":":"},{"prefix":"set_float","body":"set_float(${1:key}, ${2:value})","desc":"`set_float(key, value)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6113-L6113)","kind":1,"detail":"Method","token":":"},{"prefix":"get_float","body":"get_float(${1:key})","desc":"`get_float(key)`: Returns `0` if key not present.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6114-L6114)","kind":1,"detail":"Method","token":":"},{"prefix":"to_table","body":"to_table()","desc":"`to_table()`: returns `nil` or a table with keys:\n* `fields`: key-value storage\n* `inventory`: `{list1 = {}, ...}}` (NodeMetaRef only)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6115-L6117)","kind":1,"detail":"Method","token":":"},{"prefix":"from_table","body":"from_table(${1:nil or }{})","desc":"`from_table(nil or {})`\n* Any non-table value will clear the metadata\n* See [Node Metadata] for an example\n* returns `true` on success\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6118-L6121)","kind":1,"detail":"Method","token":":"},{"prefix":"equals","body":"equals(${1:other})","desc":"`equals(other)`\n* returns `true` if this metadata has the same key-value pairs as `other`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6122-L6123)","kind":1,"detail":"Method","token":":"},{"prefix":"leave","body":"leave()","desc":"`leave()`: leave the mod channel.\n* Server leaves channel `channel_name`.\n* No more incoming or outgoing messages can be sent to this channel from\n server mods.\n* This invalidate all future object usage.\n* Ensure you set mod_channel to nil after that to free Lua resources.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6132-L6137)","kind":1,"detail":"Method","token":":"},{"prefix":"is_writeable","body":"is_writeable()","desc":"`is_writeable()`: returns true if channel is writeable and mod can send over\n it.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6138-L6139)","kind":1,"detail":"Method","token":":"},{"prefix":"send_all","body":"send_all(${1:message})","desc":"`send_all(message)`: Send `message` though the mod channel.\n* If mod channel is not writeable or invalid, message will be dropped.\n* Message size is limited to 65535 characters by protocol.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6140-L6142)","kind":1,"detail":"Method","token":":"},{"prefix":"get_inventory","body":"get_inventory()","desc":"`get_inventory()`: returns `InvRef`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6153-L6153)","kind":1,"detail":"Method","token":":"},{"prefix":"mark_as_private","body":"mark_as_private(${1:name or }{${2:name1}, ${3:name2}, ${4:...}})","desc":"`mark_as_private(name or {name1, name2, ...})`: Mark specific vars as private\n This will prevent them from being sent to the client. Note that the \"private\"\n status will only be remembered if an associated key-value pair exists,\n meaning it's best to call this when initializing all other meta (e.g.\n `on_construct`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6154-L6158)","kind":2,"detail":"Function","token":":"},{"prefix":"set","body":"set(${1:timeout},${2:elapsed})","desc":"`set(timeout,elapsed)`\n* set a timer's state\n* `timeout` is in seconds, and supports fractional values (0.1 etc)\n* `elapsed` is in seconds, and supports fractional values (0.1 etc)\n* will trigger the node's `on_timer` function after `(timeout - elapsed)`\n seconds.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6168-L6173)","kind":1,"detail":"Method","token":":"},{"prefix":"start","body":"start(${1:timeout})","desc":"`start(timeout)`\n* start a timer\n* equivalent to `set(timeout,0)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6174-L6176)","kind":1,"detail":"Method","token":":"},{"prefix":"stop","body":"stop()","desc":"`stop()`\n* stops the timer\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6177-L6178)","kind":1,"detail":"Method","token":":"},{"prefix":"get_timeout","body":"get_timeout()","desc":"`get_timeout()`: returns current timeout in seconds\n* if `timeout` equals `0`, timer is inactive\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6179-L6180)","kind":1,"detail":"Method","token":":"},{"prefix":"get_elapsed","body":"get_elapsed()","desc":"`get_elapsed()`: returns current elapsed time in seconds\n* the node's `on_timer` function will be called after `(timeout - elapsed)`\n seconds.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6181-L6183)","kind":1,"detail":"Method","token":":"},{"prefix":"is_started","body":"is_started()","desc":"`is_started()`: returns boolean state of timer\n* returns `true` if timer is started, otherwise `false`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6184-L6185)","kind":1,"detail":"Method","token":":"},{"prefix":"get_pos","body":"get_pos()","desc":"`get_pos()`: returns `{x=num, y=num, z=num}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6209-L6209)","kind":1,"detail":"Method","token":":"},{"prefix":"set_pos","body":"set_pos(${1:pos})","desc":"`set_pos(pos)`: `pos`=`{x=num, y=num, z=num}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6210-L6210)","kind":1,"detail":"Method","token":":"},{"prefix":"get_velocity","body":"get_velocity()","desc":"`get_velocity()`: returns the velocity, a vector.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6211-L6211)","kind":1,"detail":"Method","token":":"},{"prefix":"add_velocity","body":"add_velocity(${1:vel})","desc":"`add_velocity(vel)`\n* `vel` is a vector, e.g. `{x=0.0, y=2.3, z=1.0}`\n* In comparison to using get_velocity, adding the velocity and then using\n set_velocity, add_velocity is supposed to avoid synchronization problems.\n Additionally, players also do not support set_velocity.\n* If a player:\n * Does not apply during free_move.\n * Note that since the player speed is normalized at each move step,\n increasing e.g. Y velocity beyond what would usually be achieved\n (see: physics overrides) will cause existing X/Z velocity to be reduced.\n * Example: `add_velocity({x=0, y=6.5, z=0})` is equivalent to\n pressing the jump key (assuming default settings)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6212-L6223)","kind":1,"detail":"Method","token":":"},{"prefix":"move_to","body":"move_to(${1:pos}, ${2:continuous}=${3:false})","desc":"`move_to(pos, continuous=false)`\n* Does an interpolated move for Lua entities for visually smooth transitions.\n* If `continuous` is true, the Lua entity will not be moved to the current\n position before starting the interpolated move.\n* For players this does the same as `set_pos`,`continuous` is ignored.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6224-L6228)","kind":1,"detail":"Method","token":":"},{"prefix":"punch","body":"punch(${1:puncher}, ${2:time_from_last_punch}, ${3:tool_capabilities}, ${4:direction})","desc":"`punch(puncher, time_from_last_punch, tool_capabilities, direction)`\n* `puncher` = another `ObjectRef`,\n* `time_from_last_punch` = time since last punch action of the puncher\n* `direction`: can be `nil`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6229-L6232)","kind":1,"detail":"Method","token":":"},{"prefix":"right_click","body":"right_click(${1:clicker})","desc":"`right_click(clicker)`; `clicker` is another `ObjectRef`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6233-L6233)","kind":1,"detail":"Method","token":":"},{"prefix":"get_hp","body":"get_hp()","desc":"`get_hp()`: returns number of health points\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6234-L6234)","kind":1,"detail":"Method","token":":"},{"prefix":"set_hp","body":"set_hp(${1:hp}, ${2:reason})","desc":"`set_hp(hp, reason)`: set number of health points\n* See reason in register_on_player_hpchange\n* Is limited to the range of 0 ... 65535 (2^16 - 1)\n* For players: HP are also limited by `hp_max` specified in the player's\n object properties\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6235-L6239)","kind":1,"detail":"Method","token":":"},{"prefix":"get_inventory","body":"get_inventory()","desc":"`get_inventory()`: returns an `InvRef` for players, otherwise returns `nil`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6240-L6240)","kind":1,"detail":"Method","token":":"},{"prefix":"get_wield_list","body":"get_wield_list()","desc":"`get_wield_list()`: returns the name of the inventory list the wielded item\n is in.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6241-L6242)","kind":1,"detail":"Method","token":":"},{"prefix":"get_wield_index","body":"get_wield_index()","desc":"`get_wield_index()`: returns the index of the wielded item\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6243-L6243)","kind":1,"detail":"Method","token":":"},{"prefix":"get_wielded_item","body":"get_wielded_item()","desc":"`get_wielded_item()`: returns an `ItemStack`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6244-L6244)","kind":1,"detail":"Method","token":":"},{"prefix":"set_wielded_item","body":"set_wielded_item(${1:item})","desc":"`set_wielded_item(item)`: replaces the wielded item, returns `true` if\n successful.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6245-L6246)","kind":1,"detail":"Method","token":":"},{"prefix":"set_armor_groups","body":"set_armor_groups({${1:group1}=${2:rating}, ${3:group2}=${4:rating}, ${5:...}})","desc":"`set_armor_groups({group1=rating, group2=rating, ...})`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6247-L6247)","kind":2,"detail":"Function","token":":"},{"prefix":"get_armor_groups","body":"get_armor_groups()","desc":"`get_armor_groups()`: returns a table with the armor group ratings\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6248-L6248)","kind":1,"detail":"Method","token":":"},{"prefix":"set_animation","body":"set_animation(${1:frame_range}, ${2:frame_speed}, ${3:frame_blend}, ${4:frame_loop})","desc":"`set_animation(frame_range, frame_speed, frame_blend, frame_loop)`\n* `frame_range`: table {x=num, y=num}, default: `{x=1, y=1}`\n* `frame_speed`: number, default: `15.0`\n* `frame_blend`: number, default: `0.0`\n* `frame_loop`: boolean, default: `true`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6249-L6253)","kind":1,"detail":"Method","token":":"},{"prefix":"get_animation","body":"get_animation()","desc":"`get_animation()`: returns `range`, `frame_speed`, `frame_blend` and\n `frame_loop`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6254-L6255)","kind":1,"detail":"Method","token":":"},{"prefix":"set_animation_frame_speed","body":"set_animation_frame_speed(${1:frame_speed})","desc":"`set_animation_frame_speed(frame_speed)`\n* `frame_speed`: number, default: `15.0`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6256-L6257)","kind":1,"detail":"Method","token":":"},{"prefix":"set_attach","body":"set_attach(${1:parent}${2:[, bone}, ${3:position}, ${4:rotation}, ${5:forced_visible]})","desc":"`set_attach(parent[, bone, position, rotation, forced_visible])`\n* `bone`: string. Default is `\"\"`, the root bone\n* `position`: `{x=num, y=num, z=num}`, relative, default `{x=0, y=0, z=0}`\n* `rotation`: `{x=num, y=num, z=num}` = Rotation on each axis, in degrees.\n Default `{x=0, y=0, z=0}`\n* `forced_visible`: Boolean to control whether the attached entity\n should appear in first person. Default `false`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6258-L6264)","kind":1,"detail":"Method","token":":"},{"prefix":"get_attach","body":"get_attach()","desc":"`get_attach()`: returns parent, bone, position, rotation, forced_visible,\nor nil if it isn't attached.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6265-L6266)","kind":1,"detail":"Method","token":":"},{"prefix":"get_children","body":"get_children()","desc":"`get_children()`: returns a list of ObjectRefs that are attached to the\nobject.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6267-L6268)","kind":1,"detail":"Method","token":":"},{"prefix":"set_detach","body":"set_detach()","desc":"`set_detach()`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6269-L6269)","kind":1,"detail":"Method","token":":"},{"prefix":"set_bone_position","body":"set_bone_position([${1:bone}, ${2:position}, ${3:rotation]})","desc":"`set_bone_position([bone, position, rotation])`\n* `bone`: string. Default is `\"\"`, the root bone\n* `position`: `{x=num, y=num, z=num}`, relative, `default {x=0, y=0, z=0}`\n* `rotation`: `{x=num, y=num, z=num}`, default `{x=0, y=0, z=0}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6270-L6273)","kind":1,"detail":"Method","token":":"},{"prefix":"get_bone_position","body":"get_bone_position(${1:bone})","desc":"`get_bone_position(bone)`: returns position and rotation of the bone\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6274-L6274)","kind":1,"detail":"Method","token":":"},{"prefix":"set_properties","body":"set_properties(${1:object property table})","desc":"`set_properties(object property table)`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6275-L6275)","kind":1,"detail":"Method","token":":"},{"prefix":"get_properties","body":"get_properties()","desc":"`get_properties()`: returns object property table\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6276-L6276)","kind":1,"detail":"Method","token":":"},{"prefix":"is_player","body":"is_player()","desc":"`is_player()`: returns true for players, false otherwise\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6277-L6277)","kind":1,"detail":"Method","token":":"},{"prefix":"get_nametag_attributes","body":"get_nametag_attributes()","desc":"`get_nametag_attributes()`\n* returns a table with the attributes of the nametag of an object\n* {\n text = \"\",\n color = {a=0..255, r=0..255, g=0..255, b=0..255},\n bgcolor = {a=0..255, r=0..255, g=0..255, b=0..255},\n }\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6278-L6284)","kind":1,"detail":"Method","token":":"},{"prefix":"set_nametag_attributes","body":"set_nametag_attributes(${1:attributes})","desc":"`set_nametag_attributes(attributes)`\n* sets the attributes of the nametag of an object\n* `attributes`:\n {\n text = \"My Nametag\",\n color = ColorSpec,\n -- ^ Text color\n bgcolor = ColorSpec or false,\n -- ^ Sets background color of nametag\n -- `false` will cause the background to be set automatically based on user settings\n -- Default: false\n }\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6285-L6296)","kind":1,"detail":"Method","token":":"},{"prefix":"remove","body":"remove()","desc":"`remove()`: remove object\n* The object is removed after returning from Lua. However the `ObjectRef`\n itself instantly becomes unusable with all further method calls having\n no effect and returning `nil`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6300-L6303)","kind":1,"detail":"Method","token":":"},{"prefix":"set_velocity","body":"set_velocity(${1:vel})","desc":"`set_velocity(vel)`\n* `vel` is a vector, e.g. `{x=0.0, y=2.3, z=1.0}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6304-L6305)","kind":1,"detail":"Method","token":":"},{"prefix":"set_acceleration","body":"set_acceleration(${1:acc})","desc":"`set_acceleration(acc)`\n* `acc` is a vector\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6306-L6307)","kind":1,"detail":"Method","token":":"},{"prefix":"get_acceleration","body":"get_acceleration()","desc":"`get_acceleration()`: returns the acceleration, a vector\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6308-L6308)","kind":1,"detail":"Method","token":":"},{"prefix":"set_rotation","body":"set_rotation(${1:rot})","desc":"`set_rotation(rot)`\n* `rot` is a vector (radians). X is pitch (elevation), Y is yaw (heading)\n and Z is roll (bank).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6309-L6311)","kind":1,"detail":"Method","token":":"},{"prefix":"get_rotation","body":"get_rotation()","desc":"`get_rotation()`: returns the rotation, a vector (radians)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6312-L6312)","kind":1,"detail":"Method","token":":"},{"prefix":"set_yaw","body":"set_yaw(${1:yaw})","desc":"`set_yaw(yaw)`: sets the yaw in radians (heading).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6313-L6313)","kind":1,"detail":"Method","token":":"},{"prefix":"get_yaw","body":"get_yaw()","desc":"`get_yaw()`: returns number in radians\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6314-L6314)","kind":1,"detail":"Method","token":":"},{"prefix":"set_texture_mod","body":"set_texture_mod(${1:mod})","desc":"`set_texture_mod(mod)`\n* Set a texture modifier to the base texture, for sprites and meshes.\n* When calling `set_texture_mod` again, the previous one is discarded.\n* `mod` the texture modifier. See [Texture modifiers].\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6315-L6318)","kind":1,"detail":"Method","token":":"},{"prefix":"get_texture_mod","body":"get_texture_mod()","desc":"`get_texture_mod()` returns current texture modifier\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6319-L6319)","kind":1,"detail":"Method","token":":"},{"prefix":"set_sprite","body":"set_sprite(${1:start_frame}, ${2:num_frames}, ${3:framelength}, ${4:select_x_by_camera})","desc":"`set_sprite(start_frame, num_frames, framelength, select_x_by_camera)`\n* Specifies and starts a sprite animation\n* Animations iterate along the frame `y` position.\n* `start_frame`: {x=column number, y=row number}, the coordinate of the\n first frame, default: `{x=0, y=0}`\n* `num_frames`: Total frames in the texture, default: `1`\n* `framelength`: Time per animated frame in seconds, default: `0.2`\n* `select_x_by_camera`: Only for visual = `sprite`. Changes the frame `x`\n position according to the view direction. default: `false`.\n * First column: subject facing the camera\n * Second column: subject looking to the left\n * Third column: subject backing the camera\n * Fourth column: subject looking to the right\n * Fifth column: subject viewed from above\n * Sixth column: subject viewed from below\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6320-L6334)","kind":1,"detail":"Method","token":":"},{"prefix":"get_entity_name","body":"get_entity_name()","desc":"`get_entity_name()` (**Deprecated**: Will be removed in a future version)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6335-L6335)","kind":1,"detail":"Method","token":":"},{"prefix":"get_luaentity","body":"get_luaentity()","desc":"`get_luaentity()`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6336-L6336)","kind":1,"detail":"Method","token":":"},{"prefix":"get_player_name","body":"get_player_name()","desc":"`get_player_name()`: returns `\"\"` if is not a player\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6340-L6340)","kind":1,"detail":"Method","token":":"},{"prefix":"get_player_velocity","body":"get_player_velocity()","desc":"`get_player_velocity()`: **DEPRECATED**, use get_velocity() instead.\n table {x, y, z} representing the player's instantaneous velocity in nodes/s\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6341-L6342)","kind":1,"detail":"Method","token":":"},{"prefix":"add_player_velocity","body":"add_player_velocity(${1:vel})","desc":"`add_player_velocity(vel)`: **DEPRECATED**, use add_velocity(vel) instead.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6343-L6343)","kind":1,"detail":"Method","token":":"},{"prefix":"get_look_dir","body":"get_look_dir()","desc":"`get_look_dir()`: get camera direction as a unit vector\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6344-L6344)","kind":1,"detail":"Method","token":":"},{"prefix":"get_look_vertical","body":"get_look_vertical()","desc":"`get_look_vertical()`: pitch in radians\n* Angle ranges between -pi/2 and pi/2, which are straight up and down\n respectively.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6345-L6347)","kind":1,"detail":"Method","token":":"},{"prefix":"get_look_horizontal","body":"get_look_horizontal()","desc":"`get_look_horizontal()`: yaw in radians\n* Angle is counter-clockwise from the +z direction.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6348-L6349)","kind":1,"detail":"Method","token":":"},{"prefix":"set_look_vertical","body":"set_look_vertical(${1:radians})","desc":"`set_look_vertical(radians)`: sets look pitch\n* radians: Angle from looking forward, where positive is downwards.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6350-L6351)","kind":1,"detail":"Method","token":":"},{"prefix":"set_look_horizontal","body":"set_look_horizontal(${1:radians})","desc":"`set_look_horizontal(radians)`: sets look yaw\n* radians: Angle from the +z direction, where positive is counter-clockwise.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6352-L6353)","kind":1,"detail":"Method","token":":"},{"prefix":"get_look_pitch","body":"get_look_pitch()","desc":"`get_look_pitch()`: pitch in radians - Deprecated as broken. Use\n `get_look_vertical`.\n* Angle ranges between -pi/2 and pi/2, which are straight down and up\n respectively.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6354-L6357)","kind":1,"detail":"Method","token":":"},{"prefix":"get_look_yaw","body":"get_look_yaw()","desc":"`get_look_yaw()`: yaw in radians - Deprecated as broken. Use\n `get_look_horizontal`.\n* Angle is counter-clockwise from the +x direction.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6358-L6360)","kind":1,"detail":"Method","token":":"},{"prefix":"set_look_pitch","body":"set_look_pitch(${1:radians})","desc":"`set_look_pitch(radians)`: sets look pitch - Deprecated. Use\n `set_look_vertical`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6361-L6362)","kind":1,"detail":"Method","token":":"},{"prefix":"set_look_yaw","body":"set_look_yaw(${1:radians})","desc":"`set_look_yaw(radians)`: sets look yaw - Deprecated. Use\n `set_look_horizontal`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6363-L6364)","kind":1,"detail":"Method","token":":"},{"prefix":"get_breath","body":"get_breath()","desc":"`get_breath()`: returns player's breath\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6365-L6365)","kind":1,"detail":"Method","token":":"},{"prefix":"set_breath","body":"set_breath(${1:value})","desc":"`set_breath(value)`: sets player's breath\n* values:\n * `0`: player is drowning\n * max: bubbles bar is not shown\n * See [Object properties] for more information\n* Is limited to range 0 ... 65535 (2^16 - 1)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6366-L6371)","kind":1,"detail":"Method","token":":"},{"prefix":"set_fov","body":"set_fov(${1:fov}, ${2:is_multiplier}, ${3:transition_time})","desc":"`set_fov(fov, is_multiplier, transition_time)`: Sets player's FOV\n* `fov`: FOV value.\n* `is_multiplier`: Set to `true` if the FOV value is a multiplier.\n Defaults to `false`.\n* `transition_time`: If defined, enables smooth FOV transition.\n Interpreted as the time (in seconds) to reach target FOV.\n If set to 0, FOV change is instantaneous. Defaults to 0.\n* Set `fov` to 0 to clear FOV override.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6372-L6379)","kind":1,"detail":"Method","token":":"},{"prefix":"get_fov","body":"get_fov()","desc":"`get_fov()`: Returns the following:\n* Server-sent FOV value. Returns 0 if an FOV override doesn't exist.\n* Boolean indicating whether the FOV value is a multiplier.\n* Time (in seconds) taken for the FOV transition. Set by `set_fov`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6380-L6383)","kind":1,"detail":"Method","token":":"},{"prefix":"set_attribute","body":"set_attribute(${1:attribute}, ${2:value})","desc":"`set_attribute(attribute, value)`: DEPRECATED, use get_meta() instead\n* Sets an extra attribute with value on player.\n* `value` must be a string, or a number which will be converted to a\n string.\n* If `value` is `nil`, remove attribute from player.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6384-L6388)","kind":1,"detail":"Method","token":":"},{"prefix":"get_attribute","body":"get_attribute(${1:attribute})","desc":"`get_attribute(attribute)`: DEPRECATED, use get_meta() instead\n* Returns value (a string) for extra attribute.\n* Returns `nil` if no attribute found.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6389-L6391)","kind":1,"detail":"Method","token":":"},{"prefix":"get_meta","body":"get_meta()","desc":"`get_meta()`: Returns a PlayerMetaRef.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6392-L6392)","kind":1,"detail":"Method","token":":"},{"prefix":"set_inventory_formspec","body":"set_inventory_formspec(${1:formspec})","desc":"`set_inventory_formspec(formspec)`\n* Redefine player's inventory form\n* Should usually be called in `on_joinplayer`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6393-L6395)","kind":1,"detail":"Method","token":":"},{"prefix":"get_inventory_formspec","body":"get_inventory_formspec()","desc":"`get_inventory_formspec()`: returns a formspec string\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6396-L6396)","kind":1,"detail":"Method","token":":"},{"prefix":"set_formspec_prepend","body":"set_formspec_prepend(${1:formspec})","desc":"`set_formspec_prepend(formspec)`:\n* the formspec string will be added to every formspec shown to the user,\n except for those with a no_prepend[] tag.\n* This should be used to set style elements such as background[] and\n bgcolor[], any non-style elements (eg: label) may result in weird behaviour.\n* Only affects formspecs shown after this is called.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6397-L6402)","kind":1,"detail":"Method","token":":"},{"prefix":"get_formspec_prepend","body":"get_formspec_prepend(${1:formspec})","desc":"`get_formspec_prepend(formspec)`: returns a formspec string.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6403-L6403)","kind":1,"detail":"Method","token":":"},{"prefix":"get_player_control","body":"get_player_control()","desc":"`get_player_control()`: returns table with player pressed keys\n* The table consists of fields with the following boolean values\n representing the pressed keys: `up`, `down`, `left`, `right`, `jump`,\n `aux1`, `sneak`, `dig`, `place`, `LMB`, `RMB`, and `zoom`.\n* The fields `LMB` and `RMB` are equal to `dig` and `place` respectively,\n and exist only to preserve backwards compatibility.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6404-L6409)","kind":1,"detail":"Method","token":":"},{"prefix":"get_player_control_bits","body":"get_player_control_bits()","desc":"`get_player_control_bits()`: returns integer with bit packed player pressed\n keys. Bits:\n* 0 - up\n* 1 - down\n* 2 - left\n* 3 - right\n* 4 - jump\n* 5 - aux1\n* 6 - sneak\n* 7 - dig\n* 8 - place\n* 9 - zoom\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6410-L6421)","kind":1,"detail":"Method","token":":"},{"prefix":"set_physics_override","body":"set_physics_override(${1:override_table})","desc":"`set_physics_override(override_table)`\n* `override_table` is a table with the following fields:\n * `speed`: multiplier to default walking speed value (default: `1`)\n * `jump`: multiplier to default jump value (default: `1`)\n * `gravity`: multiplier to default gravity value (default: `1`)\n * `sneak`: whether player can sneak (default: `true`)\n * `sneak_glitch`: whether player can use the new move code replications\n of the old sneak side-effects: sneak ladders and 2 node sneak jump\n (default: `false`)\n * `new_move`: use new move/sneak code. When `false` the exact old code\n is used for the specific old sneak behaviour (default: `true`)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6422-L6432)","kind":1,"detail":"Method","token":":"},{"prefix":"get_physics_override","body":"get_physics_override()","desc":"`get_physics_override()`: returns the table given to `set_physics_override`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6433-L6433)","kind":1,"detail":"Method","token":":"},{"prefix":"hud_add","body":"hud_add(${1:hud definition})","desc":"`hud_add(hud definition)`: add a HUD element described by HUD def, returns ID\n number on success\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6434-L6435)","kind":1,"detail":"Method","token":":"},{"prefix":"hud_remove","body":"hud_remove(${1:id})","desc":"`hud_remove(id)`: remove the HUD element of the specified id\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6436-L6436)","kind":1,"detail":"Method","token":":"},{"prefix":"hud_change","body":"hud_change(${1:id}, ${2:stat}, ${3:value})","desc":"`hud_change(id, stat, value)`: change a value of a previously added HUD\n element.\n* element `stat` values:\n `position`, `name`, `scale`, `text`, `number`, `item`, `dir`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6437-L6440)","kind":1,"detail":"Method","token":":"},{"prefix":"hud_get","body":"hud_get(${1:id})","desc":"`hud_get(id)`: gets the HUD element definition structure of the specified ID\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6441-L6441)","kind":1,"detail":"Method","token":":"},{"prefix":"hud_set_flags","body":"hud_set_flags(${1:flags})","desc":"`hud_set_flags(flags)`: sets specified HUD flags of player.\n* `flags`: A table with the following fields set to boolean values\n * hotbar\n * healthbar\n * crosshair\n * wielditem\n * breathbar\n * minimap\n * minimap_radar\n* If a flag equals `nil`, the flag is not modified\n* `minimap`: Modifies the client's permission to view the minimap.\n The client may locally elect to not view the minimap.\n* `minimap_radar` is only usable when `minimap` is true\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6442-L6454)","kind":1,"detail":"Method","token":":"},{"prefix":"hud_get_flags","body":"hud_get_flags()","desc":"`hud_get_flags()`: returns a table of player HUD flags with boolean values.\n* See `hud_set_flags` for a list of flags that can be toggled.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6455-L6456)","kind":1,"detail":"Method","token":":"},{"prefix":"hud_set_hotbar_itemcount","body":"hud_set_hotbar_itemcount(${1:count})","desc":"`hud_set_hotbar_itemcount(count)`: sets number of items in builtin hotbar\n* `count`: number of items, must be between `1` and `32`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6457-L6458)","kind":1,"detail":"Method","token":":"},{"prefix":"hud_set_hotbar_image","body":"hud_set_hotbar_image(${1:texturename})","desc":"`hud_set_hotbar_image(texturename)`\n* sets background image for hotbar\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6460-L6461)","kind":1,"detail":"Method","token":":"},{"prefix":"hud_set_hotbar_selected_image","body":"hud_set_hotbar_selected_image(${1:texturename})","desc":"`hud_set_hotbar_selected_image(texturename)`\n* sets image for selected item of hotbar\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6463-L6464)","kind":1,"detail":"Method","token":":"},{"prefix":"set_minimap_modes","body":"set_minimap_modes({${1:mode}, ${2:mode}, ${3:...}}, ${4:selected_mode})","desc":"`set_minimap_modes({mode, mode, ...}, selected_mode)`\n* Overrides the available minimap modes (and toggle order), and changes the\nselected mode.\n* `mode` is a table consisting of up to four fields:\n * `type`: Available type:\n * `off`: Minimap off\n * `surface`: Minimap in surface mode\n * `radar`: Minimap in radar mode\n * `texture`: Texture to be displayed instead of terrain map\n (texture is centered around 0,0 and can be scaled).\n Texture size is limited to 512 x 512 pixel.\n * `label`: Optional label to display on minimap mode toggle\n The translation must be handled within the mod.\n * `size`: Sidelength or diameter, in number of nodes, of the terrain\n displayed in minimap\n * `texture`: Only for texture type, name of the texture to display\n * `scale`: Only for texture type, scale of the texture map in nodes per\n pixel (for example a `scale` of 2 means each pixel represents a 2x2\n nodes square)\n* `selected_mode` is the mode index to be selected after modes have been changed\n(0 is the first mode).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6466-L6486)","kind":2,"detail":"Function","token":":"},{"prefix":"set_sky","body":"set_sky(${1:sky_parameters})","desc":"`set_sky(sky_parameters)`\n* The presence of the function `set_sun`, `set_moon` or `set_stars` indicates\n whether `set_sky` accepts this format. Check the legacy format otherwise.\n* `sky_parameters` is a table with the following optional fields:\n * `base_color`: ColorSpec, changes fog in \"skybox\" and \"plain\".\n * `type`: Available types:\n * `\"regular\"`: Uses 0 textures, `base_color` ignored\n * `\"skybox\"`: Uses 6 textures, `base_color` used as fog.\n * `\"plain\"`: Uses 0 textures, `base_color` used as both fog and sky.\n * `textures`: A table containing up to six textures in the following\n order: Y+ (top), Y- (bottom), X- (west), X+ (east), Z+ (north), Z- (south).\n * `clouds`: Boolean for whether clouds appear. (default: `true`)\n * `sky_color`: A table containing the following values, alpha is ignored:\n * `day_sky`: ColorSpec, for the top half of the `\"regular\"`\n sky during the day. (default: `#8cbafa`)\n * `day_horizon`: ColorSpec, for the bottom half of the\n `\"regular\"` sky during the day. (default: `#9bc1f0`)\n * `dawn_sky`: ColorSpec, for the top half of the `\"regular\"`\n sky during dawn/sunset. (default: `#b4bafa`)\n The resulting sky color will be a darkened version of the ColorSpec.\n Warning: The darkening of the ColorSpec is subject to change.\n * `dawn_horizon`: ColorSpec, for the bottom half of the `\"regular\"`\n sky during dawn/sunset. (default: `#bac1f0`)\n The resulting sky color will be a darkened version of the ColorSpec.\n Warning: The darkening of the ColorSpec is subject to change.\n * `night_sky`: ColorSpec, for the top half of the `\"regular\"`\n sky during the night. (default: `#006aff`)\n The resulting sky color will be a dark version of the ColorSpec.\n Warning: The darkening of the ColorSpec is subject to change.\n * `night_horizon`: ColorSpec, for the bottom half of the `\"regular\"`\n sky during the night. (default: `#4090ff`)\n The resulting sky color will be a dark version of the ColorSpec.\n Warning: The darkening of the ColorSpec is subject to change.\n * `indoors`: ColorSpec, for when you're either indoors or\n underground. Only applies to the `\"regular\"` sky.\n (default: `#646464`)\n * `fog_sun_tint`: ColorSpec, changes the fog tinting for the sun\n at sunrise and sunset.\n * `fog_moon_tint`: ColorSpec, changes the fog tinting for the moon\n at sunrise and sunset.\n * `fog_tint_type`: string, changes which mode the directional fog\n abides by, `\"custom\"` uses `sun_tint` and `moon_tint`, while\n `\"default\"` uses the classic Minetest sun and moon tinting.\n Will use tonemaps, if set to `\"default\"`. (default: `\"default\"`)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6487-L6530)","kind":1,"detail":"Method","token":":"},{"prefix":"set_sky","body":"set_sky(${1:base_color}, ${2:type}, {${3:texture names}}, ${4:clouds})","desc":"`set_sky(base_color, type, {texture names}, clouds)`\n* Deprecated. Use `set_sky(sky_parameters)`\n* `base_color`: ColorSpec, defaults to white\n* `type`: Available types:\n * `\"regular\"`: Uses 0 textures, `bgcolor` ignored\n * `\"skybox\"`: Uses 6 textures, `bgcolor` used\n * `\"plain\"`: Uses 0 textures, `bgcolor` used\n* `clouds`: Boolean for whether clouds appear in front of `\"skybox\"` or\n `\"plain\"` custom skyboxes (default: `true`)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6531-L6539)","kind":1,"detail":"Method","token":":"},{"prefix":"get_sky","body":"get_sky()","desc":"`get_sky()`: returns base_color, type, table of textures, clouds.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6540-L6540)","kind":1,"detail":"Method","token":":"},{"prefix":"get_sky_color","body":"get_sky_color()","desc":"`get_sky_color()`: returns a table with the `sky_color` parameters as in\n`set_sky`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6541-L6542)","kind":1,"detail":"Method","token":":"},{"prefix":"set_sun","body":"set_sun(${1:sun_parameters})","desc":"`set_sun(sun_parameters)`:\n* `sun_parameters` is a table with the following optional fields:\n * `visible`: Boolean for whether the sun is visible.\n (default: `true`)\n * `texture`: A regular texture for the sun. Setting to `\"\"`\n will re-enable the mesh sun. (default: `\"sun.png\"`)\n * `tonemap`: A 512x1 texture containing the tonemap for the sun\n (default: `\"sun_tonemap.png\"`)\n * `sunrise`: A regular texture for the sunrise texture.\n (default: `\"sunrisebg.png\"`)\n * `sunrise_visible`: Boolean for whether the sunrise texture is visible.\n (default: `true`)\n * `scale`: Float controlling the overall size of the sun. (default: `1`)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6543-L6555)","kind":1,"detail":"Method","token":":"},{"prefix":"get_sun","body":"get_sun()","desc":"`get_sun()`: returns a table with the current sun parameters as in\n`set_sun`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6556-L6557)","kind":1,"detail":"Method","token":":"},{"prefix":"set_moon","body":"set_moon(${1:moon_parameters})","desc":"`set_moon(moon_parameters)`:\n* `moon_parameters` is a table with the following optional fields:\n * `visible`: Boolean for whether the moon is visible.\n (default: `true`)\n * `texture`: A regular texture for the moon. Setting to `\"\"`\n will re-enable the mesh moon. (default: `\"moon.png\"`)\n * `tonemap`: A 512x1 texture containing the tonemap for the moon\n (default: `\"moon_tonemap.png\"`)\n * `scale`: Float controlling the overall size of the moon (default: `1`)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6558-L6566)","kind":1,"detail":"Method","token":":"},{"prefix":"get_moon","body":"get_moon()","desc":"`get_moon()`: returns a table with the current moon parameters as in\n`set_moon`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6567-L6568)","kind":1,"detail":"Method","token":":"},{"prefix":"set_stars","body":"set_stars(${1:star_parameters})","desc":"`set_stars(star_parameters)`:\n* `star_parameters` is a table with the following optional fields:\n * `visible`: Boolean for whether the stars are visible.\n (default: `true`)\n * `count`: Integer number to set the number of stars in\n the skybox. Only applies to `\"skybox\"` and `\"regular\"` sky types.\n (default: `1000`)\n * `star_color`: ColorSpec, sets the colors of the stars,\n alpha channel is used to set overall star brightness.\n (default: `#ebebff69`)\n * `scale`: Float controlling the overall size of the stars (default: `1`)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6569-L6579)","kind":1,"detail":"Method","token":":"},{"prefix":"get_stars","body":"get_stars()","desc":"`get_stars()`: returns a table with the current stars parameters as in\n`set_stars`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6580-L6581)","kind":1,"detail":"Method","token":":"},{"prefix":"set_clouds","body":"set_clouds(${1:cloud_parameters})","desc":"`set_clouds(cloud_parameters)`: set cloud parameters\n* `cloud_parameters` is a table with the following optional fields:\n * `density`: from `0` (no clouds) to `1` (full clouds) (default `0.4`)\n * `color`: basic cloud color with alpha channel, ColorSpec\n (default `#fff0f0e5`).\n * `ambient`: cloud color lower bound, use for a \"glow at night\" effect.\n ColorSpec (alpha ignored, default `#000000`)\n * `height`: cloud height, i.e. y of cloud base (default per conf,\n usually `120`)\n * `thickness`: cloud thickness in nodes (default `16`)\n * `speed`: 2D cloud speed + direction in nodes per second\n (default `{x=0, z=-2}`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6582-L6593)","kind":1,"detail":"Method","token":":"},{"prefix":"get_clouds","body":"get_clouds()","desc":"`get_clouds()`: returns a table with the current cloud parameters as in\n `set_clouds`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6594-L6595)","kind":1,"detail":"Method","token":":"},{"prefix":"override_day_night_ratio","body":"override_day_night_ratio(${1:ratio or nil})","desc":"`override_day_night_ratio(ratio or nil)`\n* `0`...`1`: Overrides day-night ratio, controlling sunlight to a specific\n amount.\n* `nil`: Disables override, defaulting to sunlight based on day-night cycle\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6596-L6599)","kind":1,"detail":"Method","token":":"},{"prefix":"get_day_night_ratio","body":"get_day_night_ratio()","desc":"`get_day_night_ratio()`: returns the ratio or nil if it isn't overridden\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6600-L6600)","kind":1,"detail":"Method","token":":"},{"prefix":"set_local_animation","body":"set_local_animation(${1:idle}, ${2:walk}, ${3:dig}, ${4:walk_while_dig}, ${5:frame_speed})","desc":"`set_local_animation(idle, walk, dig, walk_while_dig, frame_speed)`:\n set animation for player model in third person view.\n* Every animation equals to a `{x=starting frame, y=ending frame}` table.\n* `frame_speed` sets the animations frame speed. Default is 30.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6601-L6604)","kind":1,"detail":"Method","token":":"},{"prefix":"get_local_animation","body":"get_local_animation()","desc":"`get_local_animation()`: returns idle, walk, dig, walk_while_dig tables and\n `frame_speed`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6605-L6606)","kind":1,"detail":"Method","token":":"},{"prefix":"set_eye_offset","body":"set_eye_offset([${1:firstperson}, ${2:thirdperson]})","desc":"`set_eye_offset([firstperson, thirdperson])`: defines offset vectors for\n camera per player. An argument defaults to `{x=0, y=0, z=0}` if unspecified.\n* in first person view\n* in third person view (max. values `{x=-10/10,y=-10,15,z=-5/5}`)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6607-L6610)","kind":1,"detail":"Method","token":":"},{"prefix":"get_eye_offset","body":"get_eye_offset()","desc":"`get_eye_offset()`: returns first and third person offsets.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6611-L6611)","kind":1,"detail":"Method","token":":"},{"prefix":"send_mapblock","body":"send_mapblock(${1:blockpos})","desc":"`send_mapblock(blockpos)`:\n* Sends a server-side loaded mapblock to the player.\n* Returns `false` if failed.\n* Resource intensive - use sparsely\n* To get blockpos, integer divide pos by 16\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6612-L6616)","kind":1,"detail":"Method","token":":"},{"prefix":"next","body":"next()","desc":"`next()`: return next integer random number [`-2147483648`...`2147483647`]\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6629-L6629)","kind":1,"detail":"Method","token":":"},{"prefix":"next","body":"next(${1:min}, ${2:max})","desc":"`next(min, max)`: return next integer random number [`min`...`max`]\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6630-L6630)","kind":1,"detail":"Method","token":":"},{"prefix":"rand_normal_dist","body":"rand_normal_dist(${1:min}, ${2:max}, ${3:num_trials}=${4:6})","desc":"`rand_normal_dist(min, max, num_trials=6)`: return normally distributed\n random number [`min`...`max`].\n* This is only a rough approximation of a normal distribution with:\n* `mean = (max - min) / 2`, and\n* `variance = (((max - min + 1) ^ 2) - 1) / (12 * num_trials)`\n* Increasing `num_trials` improves accuracy of the approximation\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6631-L6636)","kind":1,"detail":"Method","token":":"},{"prefix":"get_2d","body":"get_2d(${1:pos})","desc":"`get_2d(pos)`: returns 2D noise value at `pos={x=,y=}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6654-L6654)","kind":1,"detail":"Method","token":":"},{"prefix":"get_3d","body":"get_3d(${1:pos})","desc":"`get_3d(pos)`: returns 3D noise value at `pos={x=,y=,z=}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6655-L6655)","kind":1,"detail":"Method","token":":"},{"prefix":"get_2d_map","body":"get_2d_map(${1:pos})","desc":"`get_2d_map(pos)`: returns a `<size.x>` times `<size.y>` 2D array of 2D noise\n with values starting at `pos={x=,y=}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6677-L6678)","kind":1,"detail":"Method","token":":"},{"prefix":"get_3d_map","body":"get_3d_map(${1:pos})","desc":"`get_3d_map(pos)`: returns a `<size.x>` times `<size.y>` times `<size.z>`\n 3D array of 3D noise with values starting at `pos={x=,y=,z=}`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6679-L6680)","kind":1,"detail":"Method","token":":"},{"prefix":"get_2d_map_flat","body":"get_2d_map_flat(${1:pos}, ${2:buffer})","desc":"`get_2d_map_flat(pos, buffer)`: returns a flat `<size.x * size.y>` element\n array of 2D noise with values starting at `pos={x=,y=}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6681-L6682)","kind":1,"detail":"Method","token":":"},{"prefix":"get_3d_map_flat","body":"get_3d_map_flat(${1:pos}, ${2:buffer})","desc":"`get_3d_map_flat(pos, buffer)`: Same as `get2dMap_flat`, but 3D noise\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6683-L6683)","kind":1,"detail":"Method","token":":"},{"prefix":"calc_2d_map","body":"calc_2d_map(${1:pos})","desc":"`calc_2d_map(pos)`: Calculates the 2d noise map starting at `pos`. The result\n is stored internally.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6684-L6685)","kind":1,"detail":"Method","token":":"},{"prefix":"calc_3d_map","body":"calc_3d_map(${1:pos})","desc":"`calc_3d_map(pos)`: Calculates the 3d noise map starting at `pos`. The result\n is stored internally.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6686-L6687)","kind":1,"detail":"Method","token":":"},{"prefix":"get_map_slice","body":"get_map_slice(${1:slice_offset}, ${2:slice_size}, ${3:buffer})","desc":"`get_map_slice(slice_offset, slice_size, buffer)`: In the form of an array,\n returns a slice of the most recently computed noise results. The result slice\n begins at coordinates `slice_offset` and takes a chunk of `slice_size`.\n E.g. to grab a 2-slice high horizontal 2d plane of noise starting at buffer\n offset y = 20:\n `noisevals = noise:get_map_slice({y=20}, {y=2})`\n It is important to note that `slice_offset` offset coordinates begin at 1,\n and are relative to the starting position of the most recently calculated\n noise.\n To grab a single vertical column of noise starting at map coordinates\n x = 1023, y=1000, z = 1000:\n `noise:calc_3d_map({x=1000, y=1000, z=1000})`\n `noisevals = noise:get_map_slice({x=24, z=1}, {x=1, z=1})`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6688-L6700)","kind":1,"detail":"Method","token":":"},{"prefix":"next","body":"next()","desc":"`next()`: return next integer random number [`0`...`32767`]\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6724-L6724)","kind":1,"detail":"Method","token":":"},{"prefix":"next","body":"next(${1:min}, ${2:max})","desc":"`next(min, max)`: return next integer random number [`min`...`max`]\n* `((max - min) == 32767) or ((max-min) <= 6553))` must be true\n due to the simple implementation making bad distribution otherwise.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6725-L6727)","kind":1,"detail":"Method","token":":"},{"prefix":"next","body":"next()","desc":"`next()`: returns a `pointed_thing` with exact pointing location\n* Returns the next thing pointed by the ray or nil.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6753-L6754)","kind":1,"detail":"Method","token":":"},{"prefix":"next_bytes","body":"next_bytes([${1:count]})","desc":"`next_bytes([count])`: return next `count` (default 1, capped at 2048) many\n random bytes, as a string.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6766-L6767)","kind":1,"detail":"Method","token":":"},{"prefix":"get","body":"get(${1:key})","desc":"`get(key)`: returns a value\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6778-L6778)","kind":1,"detail":"Method","token":":"},{"prefix":"get_bool","body":"get_bool(${1:key}, [${2:default]})","desc":"`get_bool(key, [default])`: returns a boolean\n* `default` is the value returned if `key` is not found.\n* Returns `nil` if `key` is not found and `default` not specified.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6779-L6781)","kind":1,"detail":"Method","token":":"},{"prefix":"get_np_group","body":"get_np_group(${1:key})","desc":"`get_np_group(key)`: returns a NoiseParams table\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6782-L6782)","kind":1,"detail":"Method","token":":"},{"prefix":"get_flags","body":"get_flags(${1:key})","desc":"`get_flags(key)`:\n* Returns `{flag = true/false, ...}` according to the set flags.\n* Is currently limited to mapgen flags `mg_flags` and mapgen-specific\n flags like `mgv5_spflags`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6783-L6786)","kind":1,"detail":"Method","token":":"},{"prefix":"set","body":"set(${1:key}, ${2:value})","desc":"`set(key, value)`\n* Setting names can't contain whitespace or any of `=\"{}#`.\n* Setting values can't contain the sequence `\\n\"\"\"`.\n* Setting names starting with \"secure.\" can't be set on the main settings\n object (`minetest.settings`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6787-L6791)","kind":1,"detail":"Method","token":":"},{"prefix":"set_bool","body":"set_bool(${1:key}, ${2:value})","desc":"`set_bool(key, value)`\n* See documentation for set() above.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6792-L6793)","kind":1,"detail":"Method","token":":"},{"prefix":"set_np_group","body":"set_np_group(${1:key}, ${2:value})","desc":"`set_np_group(key, value)`\n* `value` is a NoiseParams table.\n* Also, see documentation for set() above.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6794-L6796)","kind":1,"detail":"Method","token":":"},{"prefix":"remove","body":"remove(${1:key})","desc":"`remove(key)`: returns a boolean (`true` for success)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6797-L6797)","kind":1,"detail":"Method","token":":"},{"prefix":"get_names","body":"get_names()","desc":"`get_names()`: returns `{key1,...}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6798-L6798)","kind":1,"detail":"Method","token":":"},{"prefix":"write","body":"write()","desc":"`write()`: returns a boolean (`true` for success)\n* Writes changes to file.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6799-L6800)","kind":1,"detail":"Method","token":":"},{"prefix":"to_table","body":"to_table()","desc":"`to_table()`: returns `{[key1]=value1,...}`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6801-L6801)","kind":1,"detail":"Method","token":":"},{"prefix":"features","body":"features","desc":"`minetest.features`: Table containing API feature flags\n\n {\n glasslike_framed = true, -- 0.4.7\n nodebox_as_selectionbox = true, -- 0.4.7\n get_all_craft_recipes_works = true, -- 0.4.7\n -- The transparency channel of textures can optionally be used on\n -- nodes (0.4.7)\n use_texture_alpha = true,\n -- Tree and grass ABMs are no longer done from C++ (0.4.8)\n no_legacy_abms = true,\n -- Texture grouping is possible using parentheses (0.4.11)\n texture_names_parens = true,\n -- Unique Area ID for AreaStore:insert_area (0.4.14)\n area_store_custom_ids = true,\n -- add_entity supports passing initial staticdata to on_activate\n -- (0.4.16)\n add_entity_with_staticdata = true,\n -- Chat messages are no longer predicted (0.4.16)\n no_chat_message_prediction = true,\n -- The transparency channel of textures can optionally be used on\n -- objects (ie: players and lua entities) (5.0.0)\n object_use_texture_alpha = true,\n -- Object selectionbox is settable independently from collisionbox\n -- (5.0.0)\n object_independent_selectionbox = true,\n -- Specifies whether binary data can be uploaded or downloaded using\n -- the HTTP API (5.1.0)\n httpfetch_binary_data = true,\n -- Whether formspec_version[<version>] may be used (5.1.0)\n formspec_version_element = true,\n -- Whether AreaStore's IDs are kept on save/load (5.1.0)\n area_store_persistent_ids = true,\n -- Whether minetest.find_path is functional (5.2.0)\n pathfinder_works = true,\n -- Whether Collision info is available to an objects' on_step (5.3.0)\n object_step_has_moveresult = true,\n -- Whether get_velocity() and add_velocity() can be used on players (5.4.0)\n direct_velocity_on_players = true,\n -- nodedef's use_texture_alpha accepts new string modes (5.4.0)\n use_texture_alpha_string_modes = true,\n }\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4354-L4395)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"settings","body":"settings","desc":"`minetest.settings`: Settings object containing all of the settings from the\n main config file (`minetest.conf`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L4766-L4767)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"env","body":"env","desc":"`minetest.env`: `EnvRef` of the server environment and world.\n* Any function in the minetest namespace can be called using the syntax\n `minetest.env:somefunction(somearguments)`\n instead of `minetest.somefunction(somearguments)`\n* Deprecated, but support is not to be dropped soon\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5827-L5831)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_items","body":"registered_items","desc":"`minetest.registered_items`\n* Map of registered items, indexed by name\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5838-L5839)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_nodes","body":"registered_nodes","desc":"`minetest.registered_nodes`\n* Map of registered node definitions, indexed by name\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5840-L5841)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_craftitems","body":"registered_craftitems","desc":"`minetest.registered_craftitems`\n* Map of registered craft item definitions, indexed by name\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5842-L5843)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_tools","body":"registered_tools","desc":"`minetest.registered_tools`\n* Map of registered tool definitions, indexed by name\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5844-L5845)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_entities","body":"registered_entities","desc":"`minetest.registered_entities`\n* Map of registered entity prototypes, indexed by name\n* Values in this table may be modified directly.\n Note: changes to initial properties will only affect entities spawned afterwards,\n as they are only read when spawning.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5846-L5850)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"object_refs","body":"object_refs","desc":"`minetest.object_refs`\n* Map of object references, indexed by active object id\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5851-L5852)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"luaentities","body":"luaentities","desc":"`minetest.luaentities`\n* Map of Lua entities, indexed by active object id\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5853-L5854)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_abms","body":"registered_abms","desc":"`minetest.registered_abms`\n* List of ABM definitions\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5855-L5856)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_lbms","body":"registered_lbms","desc":"`minetest.registered_lbms`\n* List of LBM definitions\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5857-L5858)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_aliases","body":"registered_aliases","desc":"`minetest.registered_aliases`\n* Map of registered aliases, indexed by name\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5859-L5860)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_ores","body":"registered_ores","desc":"`minetest.registered_ores`\n* Map of registered ore definitions, indexed by the `name` field.\n* If `name` is nil, the key is the object handle returned by\n `minetest.register_ore`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5861-L5864)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_biomes","body":"registered_biomes","desc":"`minetest.registered_biomes`\n* Map of registered biome definitions, indexed by the `name` field.\n* If `name` is nil, the key is the object handle returned by\n `minetest.register_biome`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5865-L5868)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_decorations","body":"registered_decorations","desc":"`minetest.registered_decorations`\n* Map of registered decoration definitions, indexed by the `name` field.\n* If `name` is nil, the key is the object handle returned by\n `minetest.register_decoration`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5869-L5872)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_schematics","body":"registered_schematics","desc":"`minetest.registered_schematics`\n* Map of registered schematic definitions, indexed by the `name` field.\n* If `name` is nil, the key is the object handle returned by\n `minetest.register_schematic`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5873-L5876)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_chatcommands","body":"registered_chatcommands","desc":"`minetest.registered_chatcommands`\n* Map of registered chat command definitions, indexed by name\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5877-L5878)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"registered_privileges","body":"registered_privileges","desc":"`minetest.registered_privileges`\n* Map of registered privilege definitions, indexed by name\n* Registered privileges can be modified directly in this table.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5879-L5881)","kind":5,"detail":"Object","token":"minetest."},{"prefix":"formspec_version","body":"formspec_version[version]$0","desc":"### `formspec_version[<version>]`\n\n* Set the formspec version to a certain number. If not specified,\n version 1 is assumed.\n* Must be specified before `size` element.\n* Clients older than this version can neither show newer elements nor display\n elements with new arguments correctly.\n* Available since feature `formspec_version_element`.\n* See also: [Version History]\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2140-L2150)","kind":13,"detail":"Formspec Element"},{"prefix":"size","body":"size[W,H,fixed_size]$0","desc":"### `size[<W>,<H>,<fixed_size>]`\n\n* Define the size of the menu in inventory slots\n* `fixed_size`: `true`/`false` (optional)\n* deprecated: `invsize[<W>,<H>;]`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2150-L2156)","kind":13,"detail":"Formspec Element"},{"prefix":"position","body":"position[X,Y]$0","desc":"### `position[<X>,<Y>]`\n\n* Must be used after `size` element.\n* Defines the position on the game window of the formspec's `anchor` point.\n* For X and Y, 0.0 and 1.0 represent opposite edges of the game window,\n for example:\n * [0.0, 0.0] sets the position to the top left corner of the game window.\n * [1.0, 1.0] sets the position to the bottom right of the game window.\n* Defaults to the center of the game window [0.5, 0.5].\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2156-L2166)","kind":13,"detail":"Formspec Element"},{"prefix":"anchor","body":"anchor[X,Y]$0","desc":"### `anchor[<X>,<Y>]`\n\n* Must be used after both `size` and `position` (if present) elements.\n* Defines the location of the anchor point within the formspec.\n* For X and Y, 0.0 and 1.0 represent opposite edges of the formspec,\n for example:\n * [0.0, 1.0] sets the anchor to the bottom left corner of the formspec.\n * [1.0, 0.0] sets the anchor to the top right of the formspec.\n* Defaults to the center of the formspec [0.5, 0.5].\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2166-L2176)","kind":13,"detail":"Formspec Element"},{"prefix":"no_prepend","body":"no_prepend[]$0","desc":"### `no_prepend[]`\n\n* Must be used after the `size`, `position`, and `anchor` elements (if present).\n* Disables player:set_formspec_prepend() from applying to this formspec.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2179-L2184)","kind":13,"detail":"Formspec Element"},{"prefix":"real_coordinates","body":"real_coordinates[bool]$0","desc":"### `real_coordinates[<bool>]`\n\n* INFORMATION: Enable it automatically using `formspec_version` version 2 or newer.\n* When set to true, all following formspec elements will use the new coordinate system.\n* If used immediately after `size`, `position`, `anchor`, and `no_prepend` elements\n (if present), the form size will use the new coordinate system.\n* **Note**: Formspec prepends are not affected by the coordinates in the main form.\n They must enable it explicitly.\n* For information on converting forms to the new coordinate system, see `Migrating\n to Real Coordinates`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2184-L2195)","kind":13,"detail":"Formspec Element"},{"prefix":"container","body":"container[X,Y]$0","desc":"### `container[<X>,<Y>]`\n\n* Start of a container block, moves all physical elements in the container by\n (X, Y).\n* Must have matching `container_end`\n* Containers can be nested, in which case the offsets are added\n (child containers are relative to parent containers)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2195-L2203)","kind":13,"detail":"Formspec Element"},{"prefix":"container_end","body":"container_end[]$0","desc":"### `container_end[]`\n\n* End of a container, following elements are no longer relative to this\n container.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2203-L2208)","kind":13,"detail":"Formspec Element"},{"prefix":"scroll_container","body":"scroll_container[X,Y;W,H;scrollbar name;orientation;scroll factor]$0","desc":"### `scroll_container[<X>,<Y>;<W>,<H>;<scrollbar name>;<orientation>;<scroll factor>]`\n\n* Start of a scroll_container block. All contained elements will ...\n * take the scroll_container coordinate as position origin,\n * be additionally moved by the current value of the scrollbar with the name\n `scrollbar name` times `scroll factor` along the orientation `orientation` and\n * be clipped to the rectangle defined by `X`, `Y`, `W` and `H`.\n* `orientation`: possible values are `vertical` and `horizontal`.\n* `scroll factor`: optional, defaults to `0.1`.\n* Nesting is possible.\n* Some elements might work a little different if they are in a scroll_container.\n* Note: If you want the scroll_container to actually work, you also need to add a\n scrollbar element with the specified name. Furthermore, it is highly recommended\n to use a scrollbaroptions element on this scrollbar.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2208-L2223)","kind":13,"detail":"Formspec Element"},{"prefix":"scroll_container_end","body":"scroll_container_end[]$0","desc":"### `scroll_container_end[]`\n\n* End of a scroll_container, following elements are no longer bound to this\n container.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2223-L2228)","kind":13,"detail":"Formspec Element"},{"prefix":"list","body":"list[inventory location;list name;X,Y;W,H;]$0","desc":"### `list[<inventory location>;<list name>;<X>,<Y>;<W>,<H>;]`\n\n* Show an inventory list if it has been sent to the client. Nothing will\n be shown if the inventory list is of size 0.\n* **Note**: With the new coordinate system, the spacing between inventory\n slots is one-fourth the size of an inventory slot by default. Also see\n [Styling Formspecs] for changing the size of slots and spacing.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2228-L2236)","kind":13,"detail":"Formspec Element"},{"prefix":"list","body":"list[inventory location;list name;X,Y;W,H;starting item index]$0","desc":"### `list[<inventory location>;<list name>;<X>,<Y>;<W>,<H>;<starting item index>]`\n\n* Show an inventory list if it has been sent to the client. Nothing will\n be shown if the inventory list is of size 0.\n* **Note**: With the new coordinate system, the spacing between inventory\n slots is one-fourth the size of an inventory slot.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2236-L2243)","kind":13,"detail":"Formspec Element"},{"prefix":"listring","body":"listring[inventory location;list name]$0","desc":"### `listring[<inventory location>;<list name>]`\n\n* Allows to create a ring of inventory lists\n* Shift-clicking on items in one element of the ring\n will send them to the next inventory list inside the ring\n* The first occurrence of an element inside the ring will\n determine the inventory where items will be sent to\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2243-L2251)","kind":13,"detail":"Formspec Element"},{"prefix":"listring","body":"listring[]$0","desc":"### `listring[]`\n\n* Shorthand for doing `listring[<inventory location>;<list name>]`\n for the last two inventory lists added by list[...]\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2251-L2256)","kind":13,"detail":"Formspec Element"},{"prefix":"listcolors","body":"listcolors[slot_bg_normal;slot_bg_hover]$0","desc":"### `listcolors[<slot_bg_normal>;<slot_bg_hover>]`\n\n* Sets background color of slots as `ColorString`\n* Sets background color of slots on mouse hovering\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2256-L2261)","kind":13,"detail":"Formspec Element"},{"prefix":"listcolors","body":"listcolors[slot_bg_normal;slot_bg_hover;slot_border]$0","desc":"### `listcolors[<slot_bg_normal>;<slot_bg_hover>;<slot_border>]`\n\n* Sets background color of slots as `ColorString`\n* Sets background color of slots on mouse hovering\n* Sets color of slots border\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2261-L2267)","kind":13,"detail":"Formspec Element"},{"prefix":"listcolors","body":"listcolors[slot_bg_normal;slot_bg_hover;slot_border;tooltip_bgcolor;tooltip_fontcolor]$0","desc":"### `listcolors[<slot_bg_normal>;<slot_bg_hover>;<slot_border>;<tooltip_bgcolor>;<tooltip_fontcolor>]`\n\n* Sets background color of slots as `ColorString`\n* Sets background color of slots on mouse hovering\n* Sets color of slots border\n* Sets default background color of tooltips\n* Sets default font color of tooltips\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2267-L2275)","kind":13,"detail":"Formspec Element"},{"prefix":"tooltip","body":"tooltip[gui_element_name;tooltip_text;bgcolor;fontcolor]$0","desc":"### `tooltip[<gui_element_name>;<tooltip_text>;<bgcolor>;<fontcolor>]`\n\n* Adds tooltip for an element\n* `bgcolor` tooltip background color as `ColorString` (optional)\n* `fontcolor` tooltip font color as `ColorString` (optional)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2275-L2281)","kind":13,"detail":"Formspec Element"},{"prefix":"tooltip","body":"tooltip[X,Y;W,H;tooltip_text;bgcolor;fontcolor]$0","desc":"### `tooltip[<X>,<Y>;<W>,<H>;<tooltip_text>;<bgcolor>;<fontcolor>]`\n\n* Adds tooltip for an area. Other tooltips will take priority when present.\n* `bgcolor` tooltip background color as `ColorString` (optional)\n* `fontcolor` tooltip font color as `ColorString` (optional)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2281-L2287)","kind":13,"detail":"Formspec Element"},{"prefix":"image","body":"image[X,Y;W,H;texture name]$0","desc":"### `image[<X>,<Y>;<W>,<H>;<texture name>]`\n\n* Show an image\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2287-L2291)","kind":13,"detail":"Formspec Element"},{"prefix":"animated_image","body":"animated_image[X,Y;W,H;name;texture name;frame count;frame duration;frame start]$0","desc":"### `animated_image[<X>,<Y>;<W>,<H>;<name>;<texture name>;<frame count>;<frame duration>;<frame start>]`\n\n* Show an animated image. The image is drawn like a \"vertical_frames\" tile\n animation (See [Tile animation definition]), but uses a frame count/duration\n for simplicity\n* `name`: Element name to send when an event occurs. The event value is the index of the current frame.\n* `texture name`: The image to use.\n* `frame count`: The number of frames animating the image.\n* `frame duration`: Milliseconds between each frame. `0` means the frames don't advance.\n* `frame start` (Optional): The index of the frame to start on. Default `1`.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2291-L2302)","kind":13,"detail":"Formspec Element"},{"prefix":"model","body":"model[X,Y;W,H;name;mesh;textures;rotation X,Y;continuous;mouse control;frame loop range]$0","desc":"### `model[<X>,<Y>;<W>,<H>;<name>;<mesh>;<textures>;<rotation X,Y>;<continuous>;<mouse control>;<frame loop range>]`\n\n* Show a mesh model.\n* `name`: Element name that can be used for styling\n* `mesh`: The mesh model to use.\n* `textures`: The mesh textures to use according to the mesh materials.\n Texture names must be separated by commas.\n* `rotation {X,Y}` (Optional): Initial rotation of the camera.\n The axes are euler angles in degrees.\n* `continuous` (Optional): Whether the rotation is continuous. Default `false`.\n* `mouse control` (Optional): Whether the model can be controlled with the mouse. Default `true`.\n* `frame loop range` (Optional): Range of the animation frames.\n * Defaults to the full range of all available frames.\n * Syntax: `<begin>,<end>`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2302-L2317)","kind":13,"detail":"Formspec Element"},{"prefix":"item_image","body":"item_image[X,Y;W,H;item name]$0","desc":"### `item_image[<X>,<Y>;<W>,<H>;<item name>]`\n\n* Show an inventory image of registered item/node\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2317-L2321)","kind":13,"detail":"Formspec Element"},{"prefix":"bgcolor","body":"bgcolor[bgcolor;fullscreen;fbgcolor]$0","desc":"### `bgcolor[<bgcolor>;<fullscreen>;<fbgcolor>]`\n\n* Sets background color of formspec.\n* `bgcolor` and `fbgcolor` (optional) are `ColorString`s, they define the color\n of the non-fullscreen and the fullscreen background.\n* `fullscreen` (optional) can be one of the following:\n * `false`: Only the non-fullscreen background color is drawn. (default)\n * `true`: Only the fullscreen background color is drawn.\n * `both`: The non-fullscreen and the fullscreen background color are drawn.\n * `neither`: No background color is drawn.\n* Note: Leave a parameter empty to not modify the value.\n* Note: `fbgcolor`, leaving parameters empty and values for `fullscreen` that\n are not bools are only available since formspec version 3.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2321-L2335)","kind":13,"detail":"Formspec Element"},{"prefix":"background","body":"background[X,Y;W,H;texture name]$0","desc":"### `background[<X>,<Y>;<W>,<H>;<texture name>]`\n\n* Example for formspec 8x4 in 16x resolution: image shall be sized\n 8 times 16px times 4 times 16px.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2335-L2340)","kind":13,"detail":"Formspec Element"},{"prefix":"background","body":"background[X,Y;W,H;texture name;auto_clip]$0","desc":"### `background[<X>,<Y>;<W>,<H>;<texture name>;<auto_clip>]`\n\n* Example for formspec 8x4 in 16x resolution:\n image shall be sized 8 times 16px times 4 times 16px\n* If `auto_clip` is `true`, the background is clipped to the formspec size\n (`x` and `y` are used as offset values, `w` and `h` are ignored)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2340-L2347)","kind":13,"detail":"Formspec Element"},{"prefix":"background9","body":"background9[X,Y;W,H;texture name;auto_clip;middle]$0","desc":"### `background9[<X>,<Y>;<W>,<H>;<texture name>;<auto_clip>;<middle>]`\n\n* 9-sliced background. See https://en.wikipedia.org/wiki/9-slice_scaling\n* Middle is a rect which defines the middle of the 9-slice.\n * `x` - The middle will be x pixels from all sides.\n * `x,y` - The middle will be x pixels from the horizontal and y from the vertical.\n * `x,y,x2,y2` - The middle will start at x,y, and end at x2, y2. Negative x2 and y2 values\n will be added to the width and height of the texture, allowing it to be used as the\n distance from the far end.\n * All numbers in middle are integers.\n* Example for formspec 8x4 in 16x resolution:\n image shall be sized 8 times 16px times 4 times 16px\n* If `auto_clip` is `true`, the background is clipped to the formspec size\n (`x` and `y` are used as offset values, `w` and `h` are ignored)\n* Available since formspec version 2\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2347-L2363)","kind":13,"detail":"Formspec Element"},{"prefix":"pwdfield","body":"pwdfield[X,Y;W,H;name;label]$0","desc":"### `pwdfield[<X>,<Y>;<W>,<H>;<name>;<label>]`\n\n* Textual password style field; will be sent to server when a button is clicked\n* When enter is pressed in field, fields.key_enter_field will be sent with the\n name of this field.\n* With the old coordinate system, fields are a set height, but will be vertically\n centred on `H`. With the new coordinate system, `H` will modify the height.\n* `name` is the name of the field as returned in fields to `on_receive_fields`\n* `label`, if not blank, will be text printed on the top left above the field\n* See `field_close_on_enter` to stop enter closing the formspec\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2363-L2374)","kind":13,"detail":"Formspec Element"},{"prefix":"field","body":"field[X,Y;W,H;name;label;default]$0","desc":"### `field[<X>,<Y>;<W>,<H>;<name>;<label>;<default>]`\n\n* Textual field; will be sent to server when a button is clicked\n* When enter is pressed in field, `fields.key_enter_field` will be sent with\n the name of this field.\n* With the old coordinate system, fields are a set height, but will be vertically\n centred on `H`. With the new coordinate system, `H` will modify the height.\n* `name` is the name of the field as returned in fields to `on_receive_fields`\n* `label`, if not blank, will be text printed on the top left above the field\n* `default` is the default value of the field\n * `default` may contain variable references such as `${text}` which\n will fill the value from the metadata value `text`\n * **Note**: no extra text or more than a single variable is supported ATM.\n* See `field_close_on_enter` to stop enter closing the formspec\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2374-L2389)","kind":13,"detail":"Formspec Element"},{"prefix":"field","body":"field[name;label;default]$0","desc":"### `field[<name>;<label>;<default>]`\n\n* As above, but without position/size units\n* When enter is pressed in field, `fields.key_enter_field` will be sent with\n the name of this field.\n* Special field for creating simple forms, such as sign text input\n* Must be used without a `size[]` element\n* A \"Proceed\" button will be added automatically\n* See `field_close_on_enter` to stop enter closing the formspec\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2389-L2399)","kind":13,"detail":"Formspec Element"},{"prefix":"field_close_on_enter","body":"field_close_on_enter[name;close_on_enter]$0","desc":"### `field_close_on_enter[<name>;<close_on_enter>]`\n\n* <name> is the name of the field\n* if <close_on_enter> is false, pressing enter in the field will submit the\n form but not close it.\n* defaults to true when not specified (ie: no tag for a field)\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2399-L2406)","kind":13,"detail":"Formspec Element"},{"prefix":"textarea","body":"textarea[X,Y;W,H;name;label;default]$0","desc":"### `textarea[<X>,<Y>;<W>,<H>;<name>;<label>;<default>]`\n\n* Same as fields above, but with multi-line input\n* If the text overflows, a vertical scrollbar is added.\n* If the name is empty, the textarea is read-only and\n the background is not shown, which corresponds to a multi-line label.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2406-L2413)","kind":13,"detail":"Formspec Element"},{"prefix":"label","body":"label[X,Y;label]$0","desc":"### `label[<X>,<Y>;<label>]`\n\n* The label formspec element displays the text set in `label`\n at the specified position.\n* **Note**: If the new coordinate system is enabled, labels are\n positioned from the center of the text, not the top.\n* The text is displayed directly without automatic line breaking,\n so label should not be used for big text chunks. Newlines can be\n used to make labels multiline.\n* **Note**: With the new coordinate system, newlines are spaced with\n half a coordinate. With the old system, newlines are spaced 2/5 of\n an inventory slot.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2413-L2426)","kind":13,"detail":"Formspec Element"},{"prefix":"hypertext","body":"hypertext[X,Y;W,H;name;text]$0","desc":"### `hypertext[<X>,<Y>;<W>,<H>;<name>;<text>]`\n* Displays a static formatted text with hyperlinks.\n* **Note**: This element is currently unstable and subject to change.\n* `x`, `y`, `w` and `h` work as per field\n* `name` is the name of the field as returned in fields to `on_receive_fields` in case of action in text.\n* `text` is the formatted text using `Markup Language` described below.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2426-L2433)","kind":13,"detail":"Formspec Element"},{"prefix":"vertlabel","body":"vertlabel[X,Y;label]$0","desc":"### `vertlabel[<X>,<Y>;<label>]`\n* Textual label drawn vertically\n* `label` is the text on the label\n* **Note**: If the new coordinate system is enabled, vertlabels are\n positioned from the center of the text, not the left.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2433-L2439)","kind":13,"detail":"Formspec Element"},{"prefix":"button","body":"button[X,Y;W,H;name;label]$0","desc":"### `button[<X>,<Y>;<W>,<H>;<name>;<label>]`\n\n* Clickable button. When clicked, fields will be sent.\n* With the old coordinate system, buttons are a set height, but will be vertically\n centred on `H`. With the new coordinate system, `H` will modify the height.\n* `label` is the text on the button\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2439-L2446)","kind":13,"detail":"Formspec Element"},{"prefix":"image_button","body":"image_button[X,Y;W,H;texture name;name;label]$0","desc":"### `image_button[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>]`\n\n* `texture name` is the filename of an image\n* **Note**: Height is supported on both the old and new coordinate systems\n for image_buttons.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2446-L2452)","kind":13,"detail":"Formspec Element"},{"prefix":"image_button","body":"image_button[X,Y;W,H;texture name;name;label;noclip;drawborder;pressed texture name]$0","desc":"### `image_button[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>;<noclip>;<drawborder>;<pressed texture name>]`\n\n* `texture name` is the filename of an image\n* `noclip=true` means the image button doesn't need to be within specified\n formsize.\n* `drawborder`: draw button border or not\n* `pressed texture name` is the filename of an image on pressed state\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2452-L2460)","kind":13,"detail":"Formspec Element"},{"prefix":"item_image_button","body":"item_image_button[X,Y;W,H;item name;name;label]$0","desc":"### `item_image_button[<X>,<Y>;<W>,<H>;<item name>;<name>;<label>]`\n\n* `item name` is the registered name of an item/node\n* The item description will be used as the tooltip. This can be overridden with\n a tooltip element.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2460-L2466)","kind":13,"detail":"Formspec Element"},{"prefix":"button_exit","body":"button_exit[X,Y;W,H;name;label]$0","desc":"### `button_exit[<X>,<Y>;<W>,<H>;<name>;<label>]`\n\n* When clicked, fields will be sent and the form will quit.\n* Same as `button` in all other respects.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2466-L2471)","kind":13,"detail":"Formspec Element"},{"prefix":"image_button_exit","body":"image_button_exit[X,Y;W,H;texture name;name;label]$0","desc":"### `image_button_exit[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>]`\n\n* When clicked, fields will be sent and the form will quit.\n* Same as `image_button` in all other respects.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2471-L2476)","kind":13,"detail":"Formspec Element"},{"prefix":"textlist","body":"textlist[X,Y;W,H;name;listelem 1,listelem 2,...,listelem n]$0","desc":"### `textlist[<X>,<Y>;<W>,<H>;<name>;<listelem 1>,<listelem 2>,...,<listelem n>]`\n\n* Scrollable item list showing arbitrary text elements\n* `name` fieldname sent to server on doubleclick value is current selected\n element.\n* `listelements` can be prepended by #color in hexadecimal format RRGGBB\n (only).\n * if you want a listelement to start with \"#\" write \"##\".\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2476-L2485)","kind":13,"detail":"Formspec Element"},{"prefix":"textlist","body":"textlist[X,Y;W,H;name;listelem 1,listelem 2,...,listelem n;selected idx;transparent]$0","desc":"### `textlist[<X>,<Y>;<W>,<H>;<name>;<listelem 1>,<listelem 2>,...,<listelem n>;<selected idx>;<transparent>]`\n\n* Scrollable itemlist showing arbitrary text elements\n* `name` fieldname sent to server on doubleclick value is current selected\n element.\n* `listelements` can be prepended by #RRGGBB (only) in hexadecimal format\n * if you want a listelement to start with \"#\" write \"##\"\n* Index to be selected within textlist\n* `true`/`false`: draw transparent background\n* See also `minetest.explode_textlist_event`\n (main menu: `core.explode_textlist_event`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2485-L2497)","kind":13,"detail":"Formspec Element"},{"prefix":"tabheader","body":"tabheader[X,Y;name;caption 1,caption 2,...,caption n;current_tab;transparent;draw_border]$0","desc":"### `tabheader[<X>,<Y>;<name>;<caption 1>,<caption 2>,...,<caption n>;<current_tab>;<transparent>;<draw_border>]`\n\n* Show a tab**header** at specific position (ignores formsize)\n* `X` and `Y`: position of the tabheader\n* *Note*: Width and height are automatically chosen with this syntax\n* `name` fieldname data is transferred to Lua\n* `caption 1`...: name shown on top of tab\n* `current_tab`: index of selected tab 1...\n* `transparent` (optional): if true, tabs are semi-transparent\n* `draw_border` (optional): if true, draw a thin line at tab base\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2497-L2508)","kind":13,"detail":"Formspec Element"},{"prefix":"tabheader","body":"tabheader[X,Y;H;name;caption 1,caption 2,...,caption n;current_tab;transparent;draw_border]$0","desc":"### `tabheader[<X>,<Y>;<H>;<name>;<caption 1>,<caption 2>,...,<caption n>;<current_tab>;<transparent>;<draw_border>]`\n\n* Show a tab**header** at specific position (ignores formsize)\n* **Important note**: This syntax for tabheaders can only be used with the\n new coordinate system.\n* `X` and `Y`: position of the tabheader\n* `H`: height of the tabheader. Width is automatically determined with this syntax.\n* `name` fieldname data is transferred to Lua\n* `caption 1`...: name shown on top of tab\n* `current_tab`: index of selected tab 1...\n* `transparent` (optional): show transparent\n* `draw_border` (optional): draw border\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2508-L2521)","kind":13,"detail":"Formspec Element"},{"prefix":"tabheader","body":"tabheader[X,Y;W,H;name;caption 1,caption 2,...,caption n;current_tab;transparent;draw_border]$0","desc":"### `tabheader[<X>,<Y>;<W>,<H>;<name>;<caption 1>,<caption 2>,...,<caption n>;<current_tab>;<transparent>;<draw_border>]`\n\n* Show a tab**header** at specific position (ignores formsize)\n* **Important note**: This syntax for tabheaders can only be used with the\n new coordinate system.\n* `X` and `Y`: position of the tabheader\n* `W` and `H`: width and height of the tabheader\n* `name` fieldname data is transferred to Lua\n* `caption 1`...: name shown on top of tab\n* `current_tab`: index of selected tab 1...\n* `transparent` (optional): show transparent\n* `draw_border` (optional): draw border\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2521-L2534)","kind":13,"detail":"Formspec Element"},{"prefix":"box","body":"box[X,Y;W,H;color]$0","desc":"### `box[<X>,<Y>;<W>,<H>;<color>]`\n\n* Simple colored box\n* `color` is color specified as a `ColorString`.\n If the alpha component is left blank, the box will be semitransparent.\n If the color is not specified, the box will use the options specified by\n its style. If the color is specified, all styling options will be ignored.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2534-L2542)","kind":13,"detail":"Formspec Element"},{"prefix":"dropdown","body":"dropdown[X,Y;W;name;item 1,item 2, ...,item n;selected idx;index event]$0","desc":"### `dropdown[<X>,<Y>;<W>;<name>;<item 1>,<item 2>, ...,<item n>;<selected idx>;<index event>]`\n\n* Show a dropdown field\n* **Important note**: There are two different operation modes:\n 1. handle directly on change (only changed dropdown is submitted)\n 2. read the value on pressing a button (all dropdown values are available)\n* `X` and `Y`: position of the dropdown\n* `W`: width of the dropdown. Height is automatically chosen with this syntax.\n* Fieldname data is transferred to Lua\n* Items to be shown in dropdown\n* Index of currently selected dropdown item\n* `index event` (optional, allowed parameter since formspec version 4): Specifies the\n event field value for selected items.\n * `true`: Selected item index\n * `false` (default): Selected item value\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2542-L2558)","kind":13,"detail":"Formspec Element"},{"prefix":"dropdown","body":"dropdown[X,Y;W,H;name;item 1,item 2, ...,item n;selected idx;index event]$0","desc":"### `dropdown[<X>,<Y>;<W>,<H>;<name>;<item 1>,<item 2>, ...,<item n>;<selected idx>;<index event>]`\n\n* Show a dropdown field\n* **Important note**: This syntax for dropdowns can only be used with the\n new coordinate system.\n* **Important note**: There are two different operation modes:\n 1. handle directly on change (only changed dropdown is submitted)\n 2. read the value on pressing a button (all dropdown values are available)\n* `X` and `Y`: position of the dropdown\n* `W` and `H`: width and height of the dropdown\n* Fieldname data is transferred to Lua\n* Items to be shown in dropdown\n* Index of currently selected dropdown item\n* `index event` (optional, allowed parameter since formspec version 4): Specifies the\n event field value for selected items.\n * `true`: Selected item index\n * `false` (default): Selected item value\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2558-L2576)","kind":13,"detail":"Formspec Element"},{"prefix":"checkbox","body":"checkbox[X,Y;name;label;selected]$0","desc":"### `checkbox[<X>,<Y>;<name>;<label>;<selected>]`\n\n* Show a checkbox\n* `name` fieldname data is transferred to Lua\n* `label` to be shown left of checkbox\n* `selected` (optional): `true`/`false`\n* **Note**: If the new coordinate system is enabled, checkboxes are\n positioned from the center of the checkbox, not the top.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2576-L2585)","kind":13,"detail":"Formspec Element"},{"prefix":"scrollbar","body":"scrollbar[X,Y;W,H;orientation;name;value]$0","desc":"### `scrollbar[<X>,<Y>;<W>,<H>;<orientation>;<name>;<value>]`\n\n* Show a scrollbar using options defined by the previous `scrollbaroptions[]`\n* There are two ways to use it:\n 1. handle the changed event (only changed scrollbar is available)\n 2. read the value on pressing a button (all scrollbars are available)\n* `orientation`: `vertical`/`horizontal`. Default horizontal.\n* Fieldname data is transferred to Lua\n* Value of this trackbar is set to (`0`-`1000`) by default\n* See also `minetest.explode_scrollbar_event`\n (main menu: `core.explode_scrollbar_event`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2585-L2597)","kind":13,"detail":"Formspec Element"},{"prefix":"scrollbaroptions","body":"scrollbaroptions[opt1;opt2;...]$0","desc":"### `scrollbaroptions[opt1;opt2;...]`\n* Sets options for all following `scrollbar[]` elements\n* `min=<int>`\n * Sets scrollbar minimum value, defaults to `0`.\n* `max=<int>`\n * Sets scrollbar maximum value, defaults to `1000`.\n If the max is equal to the min, the scrollbar will be disabled.\n* `smallstep=<int>`\n * Sets scrollbar step value when the arrows are clicked or the mouse wheel is\n scrolled.\n * If this is set to a negative number, the value will be reset to `10`.\n* `largestep=<int>`\n * Sets scrollbar step value used by page up and page down.\n * If this is set to a negative number, the value will be reset to `100`.\n* `thumbsize=<int>`\n * Sets size of the thumb on the scrollbar. Size is calculated in the number of\n units the thumb spans out of the range of the scrollbar values.\n * Example: If a scrollbar has a `min` of 1 and a `max` of 100, a thumbsize of 10\n would span a tenth of the scrollbar space.\n * If this is set to zero or less, the value will be reset to `1`.\n* `arrows=<show/hide/default>`\n * Whether to show the arrow buttons on the scrollbar. `default` hides the arrows\n when the scrollbar gets too small, but shows them otherwise.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2597-L2621)","kind":13,"detail":"Formspec Element"},{"prefix":"table","body":"table[X,Y;W,H;name;cell 1,cell 2,...,cell n;selected idx]$0","desc":"### `table[<X>,<Y>;<W>,<H>;<name>;<cell 1>,<cell 2>,...,<cell n>;<selected idx>]`\n\n* Show scrollable table using options defined by the previous `tableoptions[]`\n* Displays cells as defined by the previous `tablecolumns[]`\n* `name`: fieldname sent to server on row select or doubleclick\n* `cell 1`...`cell n`: cell contents given in row-major order\n* `selected idx`: index of row to be selected within table (first row = `1`)\n* See also `minetest.explode_table_event`\n (main menu: `core.explode_table_event`).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2621-L2631)","kind":13,"detail":"Formspec Element"},{"prefix":"tableoptions","body":"tableoptions[opt 1;opt 2;...]$0","desc":"### `tableoptions[<opt 1>;<opt 2>;...]`\n\n* Sets options for `table[]`\n* `color=#RRGGBB`\n * default text color (`ColorString`), defaults to `#FFFFFF`\n* `background=#RRGGBB`\n * table background color (`ColorString`), defaults to `#000000`\n* `border=<true/false>`\n * should the table be drawn with a border? (default: `true`)\n* `highlight=#RRGGBB`\n * highlight background color (`ColorString`), defaults to `#466432`\n* `highlight_text=#RRGGBB`\n * highlight text color (`ColorString`), defaults to `#FFFFFF`\n* `opendepth=<value>`\n * all subtrees up to `depth < value` are open (default value = `0`)\n * only useful when there is a column of type \"tree\"\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2631-L2648)","kind":13,"detail":"Formspec Element"},{"prefix":"tablecolumns","body":"tablecolumns[type 1,opt 1a,opt 1b,...;type 2,opt 2a,opt 2b;...]$0","desc":"### `tablecolumns[<type 1>,<opt 1a>,<opt 1b>,...;<type 2>,<opt 2a>,<opt 2b>;...]`\n\n* Sets columns for `table[]`\n* Types: `text`, `image`, `color`, `indent`, `tree`\n * `text`: show cell contents as text\n * `image`: cell contents are an image index, use column options to define\n images.\n * `color`: cell contents are a ColorString and define color of following\n cell.\n * `indent`: cell contents are a number and define indentation of following\n cell.\n * `tree`: same as indent, but user can open and close subtrees\n (treeview-like).\n* Column options:\n * `align=<value>`\n * for `text` and `image`: content alignment within cells.\n Available values: `left` (default), `center`, `right`, `inline`\n * `width=<value>`\n * for `text` and `image`: minimum width in em (default: `0`)\n * for `indent` and `tree`: indent width in em (default: `1.5`)\n * `padding=<value>`: padding left of the column, in em (default `0.5`).\n Exception: defaults to 0 for indent columns\n * `tooltip=<value>`: tooltip text (default: empty)\n * `image` column options:\n * `0=<value>` sets image for image index 0\n * `1=<value>` sets image for image index 1\n * `2=<value>` sets image for image index 2\n * and so on; defined indices need not be contiguous empty or\n non-numeric cells are treated as `0`.\n * `color` column options:\n * `span=<value>`: number of following columns to affect\n (default: infinite).\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2648-L2681)","kind":13,"detail":"Formspec Element"},{"prefix":"style","body":"style[selector 1,selector 2;prop1;prop2;...]$0","desc":"### `style[<selector 1>,<selector 2>;<prop1>;<prop2>;...]`\n\n* Set the style for the element(s) matching `selector` by name.\n* `selector` can be one of:\n * `<name>` - An element name. Includes `*`, which represents every element.\n * `<name>:<state>` - An element name, a colon, and one or more states.\n* `state` is a list of states separated by the `+` character.\n * If a state is provided, the style will only take effect when the element is in that state.\n * All provided states must be active for the style to apply.\n* Note: this **must** be before the element is defined.\n* See [Styling Formspecs].\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2681-L2693)","kind":13,"detail":"Formspec Element"},{"prefix":"style_type","body":"style_type[selector 1,selector 2;prop1;prop2;...]$0","desc":"### `style_type[<selector 1>,<selector 2>;<prop1>;<prop2>;...]`\n\n* Set the style for the element(s) matching `selector` by type.\n* `selector` can be one of:\n * `<type>` - An element type. Includes `*`, which represents every element.\n * `<type>:<state>` - An element type, a colon, and one or more states.\n* `state` is a list of states separated by the `+` character.\n * If a state is provided, the style will only take effect when the element is in that state.\n * All provided states must be active for the style to apply.\n* See [Styling Formspecs].\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2694-L2705)","kind":13,"detail":"Formspec Element"},{"prefix":"set_focus","body":"set_focus[name;force]$0","desc":"### `set_focus[<name>;<force>]`\n\n* Sets the focus to the element with the same `name` parameter.\n* **Note**: This element must be placed before the element it focuses.\n* `force` (optional, default `false`): By default, focus is not applied for\n re-sent formspecs with the same name so that player-set focus is kept.\n `true` sets the focus to the specified element for every sent formspec.\n* The following elements have the ability to be focused:\n * checkbox\n * button\n * button_exit\n * image_button\n * image_button_exit\n * item_image_button\n * table\n * textlist\n * dropdown\n * field\n * pwdfield\n * textarea\n * scrollbar\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L2705-L2727)","kind":13,"detail":"Formspec Element"},{"prefix":"combine","body":"combine:${1:<w>}x${2:<h>}:${3:<x1>},${4:<y1>}=${5:<file1>}:${6:<x2>},${7:<y2>}=${8:<file2>}:${9:...}$0","desc":"#### `[combine:<w>x<h>:<x1>,<y1>=<file1>:<x2>,<y2>=<file2>:...`\n\n* `<w>`: width\n* `<h>`: height\n* `<x>`: x position\n* `<y>`: y position\n* `<file>`: texture to combine\n\nCreates a texture of size `<w>` times `<h>` and blits the listed files to their\nspecified coordinates.\n\nExample:\n\n [combine:16x32:0,0=default_cobble.png:0,16=default_wood.png\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L470-L484)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"resize","body":"resize:${1:<w>}x${2:<h>}$0","desc":"#### `[resize:<w>x<h>`\n\nResizes the texture to the given dimensions.\n\nExample:\n\n default_sandstone.png^[resize:16x16\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L485-L492)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"opacity","body":"opacity:${1:<r>}$0","desc":"#### `[opacity:<r>`\n\nMakes the base image transparent according to the given ratio.\n\n`r` must be between 0 (transparent) and 255 (opaque).\n\nExample:\n\n default_sandstone.png^[opacity:127\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L493-L502)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"invert","body":"invert:${1:<mode>}$0","desc":"#### `[invert:<mode>`\n\nInverts the given channels of the base image.\nMode may contain the characters \"r\", \"g\", \"b\", \"a\".\nOnly the channels that are mentioned in the mode string will be inverted.\n\nExample:\n\n default_apple.png^[invert:rgb\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L503-L512)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"brighten","body":"brighten$0","desc":"#### `[brighten`\n\nBrightens the texture.\n\nExample:\n\n tnt_tnt_side.png^[brighten\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L513-L520)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"noalpha","body":"noalpha$0","desc":"#### `[noalpha`\n\nMakes the texture completely opaque.\n\nExample:\n\n default_leaves.png^[noalpha\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L521-L528)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"makealpha","body":"makealpha:${1:<r>},${2:<g>},${3:<b>}$0","desc":"#### `[makealpha:<r>,<g>,<b>`\n\nConvert one color to transparency.\n\nExample:\n\n default_cobble.png^[makealpha:128,128,128\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L529-L536)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"transform","body":"transform${1:<t>}$0","desc":"#### `[transform<t>`\n\n* `<t>`: transformation(s) to apply\n\nRotates and/or flips the image.\n\n`<t>` can be a number (between 0 and 7) or a transform name.\nRotations are counter-clockwise.\n\n 0 I identity\n 1 R90 rotate by 90 degrees\n 2 R180 rotate by 180 degrees\n 3 R270 rotate by 270 degrees\n 4 FX flip X\n 5 FXR90 flip X then rotate by 90 degrees\n 6 FY flip Y\n 7 FYR90 flip Y then rotate by 90 degrees\n\nExample:\n\n default_stone.png^[transformFXR90\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L537-L558)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"inventorycube","body":"inventorycube{${1:<top>}{${2:<left>}{${3:<right>}$0","desc":"#### `[inventorycube{<top>{<left>{<right>`\n\nEscaping does not apply here and `^` is replaced by `&` in texture names\ninstead.\n\nCreate an inventory cube texture using the side textures.\n\nExample:\n\n [inventorycube{grass.png{dirt.png&grass_side.png{dirt.png&grass_side.png\n\nCreates an inventorycube with `grass.png`, `dirt.png^grass_side.png` and\n`dirt.png^grass_side.png` textures\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L559-L572)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"lowpart","body":"lowpart:${1:<percent>}:${2:<file>}$0","desc":"#### `[lowpart:<percent>:<file>`\n\nBlit the lower `<percent>`% part of `<file>` on the texture.\n\nExample:\n\n base.png^[lowpart:25:overlay.png\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L573-L580)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"verticalframe","body":"verticalframe:${1:<t>}:${2:<n>}$0","desc":"#### `[verticalframe:<t>:<n>`\n\n* `<t>`: animation frame count\n* `<n>`: current animation frame\n\nCrops the texture to a frame of a vertical animation.\n\nExample:\n\n default_torch_animated.png^[verticalframe:16:8\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L581-L591)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"mask","body":"mask:${1:<file>}$0","desc":"#### `[mask:<file>`\n\nApply a mask to the base image.\n\nThe mask is applied using binary AND.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L592-L597)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"sheet","body":"sheet:${1:<w>}x${2:<h>}:${3:<x>},${4:<y>}$0","desc":"#### `[sheet:<w>x<h>:<x>,<y>`\n\nRetrieves a tile at position x,y from the base image\nwhich it assumes to be a tilesheet with dimensions w,h.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L598-L602)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"colorize","body":"colorize:${1:<color>}:${2:<ratio>}$0","desc":"#### `[colorize:<color>:<ratio>`\n\nColorize the textures with the given color.\n`<color>` is specified as a `ColorString`.\n`<ratio>` is an int ranging from 0 to 255 or the word \"`alpha`\". If\nit is an int, then it specifies how far to interpolate between the\ncolors where 0 is only the texture color and 255 is only `<color>`. If\nomitted, the alpha of `<color>` will be used as the ratio. If it is\nthe word \"`alpha`\", then each texture pixel will contain the RGB of\n`<color>` and the alpha of `<color>` multiplied by the alpha of the\ntexture pixel.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L603-L614)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"multiply","body":"multiply:${1:<color>}$0","desc":"#### `[multiply:<color>`\n\nMultiplies texture colors with the given color.\n`<color>` is specified as a `ColorString`.\nResult is more like what you'd expect if you put a color on top of another\ncolor, meaning white surfaces get a lot of your new color while black parts\ndon't change very much.\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L615-L623)","kind":7,"detail":"Texture Modifier","token":"["},{"prefix":"minetest.CONTENT_UNKNOWN","body":"CONTENT_UNKNOWN","desc":"`minetest.CONTENT_UNKNOWN`: ID for \"unknown\" nodes\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3952-L3952)","kind":11,"detail":"Constant","token":"minetest."},{"prefix":"minetest.CONTENT_AIR","body":"CONTENT_AIR","desc":"`minetest.CONTENT_AIR`: ID for \"air\" nodes\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3953-L3953)","kind":11,"detail":"Constant","token":"minetest."},{"prefix":"minetest.CONTENT_IGNORE","body":"CONTENT_IGNORE","desc":"`minetest.CONTENT_IGNORE`: ID for \"ignore\" nodes\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L3954-L3954)","kind":11,"detail":"Constant","token":"minetest."},{"prefix":"minetest.EMERGE_CANCELLED","body":"EMERGE_CANCELLED","desc":"`minetest.EMERGE_CANCELLED`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5078-L5078)","kind":11,"detail":"Constant","token":"minetest."},{"prefix":"minetest.EMERGE_ERRORED","body":"EMERGE_ERRORED","desc":"`minetest.EMERGE_ERRORED`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5079-L5079)","kind":11,"detail":"Constant","token":"minetest."},{"prefix":"minetest.EMERGE_FROM_MEMORY","body":"EMERGE_FROM_MEMORY","desc":"`minetest.EMERGE_FROM_MEMORY`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5080-L5080)","kind":11,"detail":"Constant","token":"minetest."},{"prefix":"minetest.EMERGE_FROM_DISK","body":"EMERGE_FROM_DISK","desc":"`minetest.EMERGE_FROM_DISK`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5081-L5081)","kind":11,"detail":"Constant","token":"minetest."},{"prefix":"minetest.EMERGE_GENERATED","body":"EMERGE_GENERATED","desc":"`minetest.EMERGE_GENERATED`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L5082-L5082)","kind":11,"detail":"Constant","token":"minetest."},{"prefix":"minetest.PLAYER_MAX_HP_DEFAULT","body":"PLAYER_MAX_HP_DEFAULT","desc":"`minetest.PLAYER_MAX_HP_DEFAULT`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6843-L6843)","kind":11,"detail":"Constant","token":"minetest."},{"prefix":"minetest.PLAYER_MAX_BREATH_DEFAULT","body":"PLAYER_MAX_BREATH_DEFAULT","desc":"`minetest.PLAYER_MAX_BREATH_DEFAULT`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L6846-L6846)","kind":11,"detail":"Constant","token":"minetest."},{"prefix":"minetest.LIGHT_MAX","body":"LIGHT_MAX","desc":"`minetest.LIGHT_MAX`\n\n[View in lua_api.txt](https://github.com/minetest/minetest/blob/5.4.1/doc/lua_api.txt#L7232-L7232)","kind":11,"detail":"Constant","token":"minetest."}]