-dump2(obj, name="_", dumped={})
-^ Return object serialized as a string, handles reference loops
-dump(obj, dumped={})
-^ Return object serialized as a string
-math.hypot(x, y)
-^ Get the hypotenuse of a triangle with legs x and y.
- Usefull for distance calculation.
-string:split(separator)
-^ eg. string:split("a,b", ",") == {"a","b"}
-string:trim()
-^ eg. string.trim("\n \t\tfoo bar\t ") == "foo bar"
-minetest.pos_to_string({x=X,y=Y,z=Z}) -> "(X,Y,Z)"
-^ Convert position to a printable string
-minetest.string_to_pos(string) -> position
-^ Same but in reverse
-^ escapes characters [ ] \ , ; that can not be used in formspecs
-minetest.is_yes(arg)
-^ returns whether arg can be interpreted as yes
-
-minetest namespace reference
------------------------------
-Utilities:
-minetest.get_current_modname() -> string
-minetest.get_modpath(modname) -> eg. "/home/user/.minetest/usermods/modname"
-^ Useful for loading additional .lua modules or static data from mod
-minetest.get_modnames() -> list of installed mods
-^ Return a list of installed mods, sorted alphabetically
-minetest.get_worldpath() -> eg. "/home/user/.minetest/world"
-^ Useful for storing custom data
-minetest.is_singleplayer()
-minetest.features
-^ table containing API feature flags: {foo=true, bar=true}
-minetest.has_feature(arg) -> bool, missing_features
-^ arg: string or table in format {foo=true, bar=true}
-^ missing_features: {foo=true, bar=true}
-
-Logging:
-minetest.debug(line)
-^ Always printed to stderr and logfile (print() is redirected here)
-minetest.log(line)
-minetest.log(loglevel, line)
-^ loglevel one of "error", "action", "info", "verbose"
-
-Registration functions: (Call these only at load time)
-minetest.register_entity(name, prototype table)
-minetest.register_abm(abm definition)
-minetest.register_node(name, node definition)
-minetest.register_tool(name, item definition)
-minetest.register_craftitem(name, item definition)
-minetest.register_alias(name, convert_to)
-minetest.register_craft(recipe)
-minetest.register_ore(ore definition)
-minetest.register_decoration(decoration definition)
-
-Global callback registration functions: (Call these only at load time)
-minetest.register_globalstep(func(dtime))
-^ Called every server step, usually interval of 0.05s
-minetest.register_on_shutdown(func())
-^ Called before server shutdown
-^ WARNING: If the server terminates abnormally (i.e. crashes), the registered
- callbacks WILL LIKELY NOT BE RUN. Data should be saved at
- semi-frequent intervals as well as on server shutdown.
-minetest.register_on_placenode(func(pos, newnode, placer, oldnode, itemstack))
-^ Called when a node has been placed
-^ If return true no item is taken from itemstack
-^ Not recommended; use on_construct or after_place_node in node definition
-^ whenever possible
-minetest.register_on_dignode(func(pos, oldnode, digger))
-^ Called when a node has been dug.
-^ Not recommended: Use on_destruct or after_dig_node in node definition
-^ whenever possible
-minetest.register_on_punchnode(func(pos, node, puncher))
-^ Called when a node is punched
-minetest.register_on_generated(func(minp, maxp, blockseed))
-^ Called after generating a piece of world. Modifying nodes inside the area
- is a bit faster than usually.
-minetest.register_on_newplayer(func(ObjectRef))
-^ Called after a new player has been created
-minetest.register_on_dieplayer(func(ObjectRef))
-^ Called when a player dies
-minetest.register_on_respawnplayer(func(ObjectRef))
-^ Called when player is to be respawned
-^ Called _before_ repositioning of player occurs
-^ return true in func to disable regular player placement
-minetest.register_on_joinplayer(func(ObjectRef))
-^ Called when a player joins the game
-minetest.register_on_leaveplayer(func(ObjectRef))
-^ Called when a player leaves the game
-minetest.register_on_cheat(func(ObjectRef, cheat))
-^ Called when a player cheats
-^ cheat: {type="moved_too_fast"/"interacted_too_far"/"finished_unknown_dig"/"dug_unbreakable"/"dug_too_fast"}
-minetest.register_on_chat_message(func(name, message))
-^ Called always when a player says something
-minetest.register_on_player_receive_fields(func(player, formname, fields))
-^ Called when a button is pressed in player's inventory form
-^ Newest functions are called first
-^ If function returns true, remaining functions are not called
-minetest.register_on_mapgen_init(func(MapgenParams))
-^ Called just before the map generator is initialized but before the environment is initialized
-^ MapgenParams consists of a table with the fields mgname, seed, water_level, and flags
-
-Other registration functions:
-minetest.register_chatcommand(cmd, chatcommand definition)
-minetest.register_privilege(name, definition)
-^ definition: "description text"
-^ definition: {
- description = "description text",
- give_to_singleplayer = boolean, -- default: true
- }
-minetest.register_authentication_handler(handler)
-^ See minetest.builtin_auth_handler in builtin.lua for reference
-
-Setting-related:
-minetest.setting_set(name, value)
-minetest.setting_get(name) -> string or nil
-minetest.setting_setbool(name, value)
-minetest.setting_getbool(name) -> boolean value or nil
-minetest.setting_get_pos(name) -> position or nil
-minetest.setting_save() -> nil, save all settings to config file
-
-Authentication:
-minetest.notify_authentication_modified(name)
-^ Should be called by the authentication handler if privileges change.
-^ To report everybody, set name=nil.
-minetest.get_password_hash(name, raw_password)
-^ Convert a name-password pair to a password hash that minetest can use
-minetest.string_to_privs(str) -> {priv1=true,...}
-minetest.privs_to_string(privs) -> "priv1,priv2,..."
-^ Convert between two privilege representations
-minetest.set_player_password(name, password_hash)
-minetest.set_player_privs(name, {priv1=true,...})
-minetest.get_player_privs(name) -> {priv1=true,...}
-minetest.auth_reload()
-^ These call the authentication handler
-minetest.check_player_privs(name, {priv1=true,...}) -> bool, missing_privs
-^ A quickhand for checking privileges
-minetest.get_player_ip(name) -> IP address string
-
-Chat:
-minetest.chat_send_all(text)
-minetest.chat_send_player(name, text, prepend)
-^ prepend: optional, if it is set to false "Server -!- " will not be prepended to the message
-
-Environment access:
-
-minetest.set_node(pos, node)
-minetest.add_node(pos, node): alias set_node(pos, node)
-^ Set node at position (node = {name="foo", param1=0, param2=0})
-minetest.remove_node(pos)
-^ Equivalent to set_node(pos, "air")
-minetest.get_node(pos)
-^ Returns {name="ignore", ...} for unloaded area
-minetest.get_node_or_nil(pos)
-^ Returns nil for unloaded area
-minetest.get_node_light(pos, timeofday) -> 0...15 or nil
-^ timeofday: nil = current time, 0 = night, 0.5 = day
-
-minetest.place_node(pos, node)
-^ Place node with the same effects that a player would cause
-minetest.dig_node(pos)
-^ Dig node with the same effects that a player would cause
-minetest.punch_node(pos)
-^ Punch node with the same effects that a player would cause
-
-minetest.get_meta(pos) -- Get a NodeMetaRef at that position
-minetest.get_node_timer(pos) -- Get NodeTimerRef
-
-minetest.add_entity(pos, name): Spawn Lua-defined entity at position
-^ Returns ObjectRef, or nil if failed
-minetest.add_item(pos, item): Spawn item
-^ Returns ObjectRef, or nil if failed
-minetest.get_player_by_name(name) -- Get an ObjectRef to a player
-minetest.get_objects_inside_radius(pos, radius)
-minetest.set_timeofday(val): val: 0...1; 0 = midnight, 0.5 = midday
-minetest.get_timeofday()
-minetest.get_gametime(): returns the time, in seconds, since the world was created
-minetest.find_node_near(pos, radius, nodenames) -> pos or nil
-^ nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
-minetest.find_nodes_in_area(minp, maxp, nodenames) -> list of positions
-^ nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
-minetest.get_perlin(seeddiff, octaves, persistence, scale)
-^ Return world-specific perlin noise (int(worldseed)+seeddiff)
-minetest.get_voxel_manip()
-^ Return voxel manipulator object
-minetest.get_mapgen_object(objectname)
-^ Return requested mapgen object if available (see Mapgen objects)
-minetest.set_mapgen_params(MapgenParams)
-^ Set map generation parameters
-^ Function cannot be called after the registration period; only initialization and on_mapgen_init
-^ Takes a table as an argument with the fields mgname, seed, water_level, flags, and flagmask.
-^ Leave field unset to leave that parameter unchanged
-^ flagmask field must be set to all mapgen flags that are being modified
-^ flags contains only the flags that are being set
-^ flags and flagmask are in the same format and have the same options as 'mgflags' in minetest.conf
-minetest.clear_objects()
-^ clear all objects in the environments
-minetest.line_of_sight(pos1,pos2,stepsize) ->true/false
-^ checkif there is a direct line of sight between pos1 and pos2
-^ pos1 First position
-^ pos2 Second position
-^ stepsize smaller gives more accurate results but requires more computing
- time. Default is 1.
-minetest.find_path(pos1,pos2,searchdistance,max_jump,max_drop,algorithm)
-^ -> table containing path
-^ returns a table of 3d points representing a path from pos1 to pos2 or nil
-^ pos1: start position
-^ pos2: end position
-^ searchdistance: number of blocks to search in each direction
-^ max_jump: maximum height difference to consider walkable
-^ max_drop: maximum height difference to consider droppable
-^ algorithm: A*_noprefetch(default), A*, Dijkstra
-minetest.spawn_tree (pos, {treedef})
-^ spawns L-System tree at given pos with definition in treedef table
-minetest.transforming_liquid_add(pos)
-^ add node to liquid update queue
-minetest.get_node_max_level(pos)
-^ get max available level for leveled node
-minetest.get_node_level(pos)
-^ get level of leveled node (water, snow)
-minetest.set_node_level(pos, level)
-^ set level of leveled node, default level = 1, if totallevel > maxlevel returns rest (total-max).
-minetest.add_node_level(pos, level)
-^ increase level of leveled node by level, default level = 1, if totallevel > maxlevel returns rest (total-max). can be negative for decreasing
-minetest.get_heat(pos)
-^ heat at pos
-minetest.get_humidity(pos)
-^ humidity at pos
-
-Inventory:
-minetest.get_inventory(location) -> InvRef
-^ location = eg. {type="player", name="celeron55"}
- {type="node", pos={x=, y=, z=}}
- {type="detached", name="creative"}
-minetest.create_detached_inventory(name, callbacks) -> InvRef
-^ callbacks: See "Detached inventory callbacks"
-^ Creates a detached inventory. If it already exists, it is cleared.
-minetest.show_formspec(playername, formname, formspec)
-^ playername: name of player to show formspec
-^ formname: name passed to on_player_receive_fields callbacks
-^ should follow "modname:<whatever>" naming convention
-^ formspec: formspec to display
-
-Item handling:
-minetest.inventorycube(img1, img2, img3)
-^ Returns a string for making an image of a cube (useful as an item image)
-minetest.get_pointed_thing_position(pointed_thing, above)
-^ Get position of a pointed_thing (that you can get from somewhere)
-minetest.dir_to_facedir(dir, is6d)
-^ Convert a vector to a facedir value, used in param2 for paramtype2="facedir"; passing something non-nil/false for the optional second parameter causes it to take the y component into account
-minetest.facedir_to_dir(facedir)
-^ Convert a facedir back into a vector aimed directly out the "back" of a node
-minetest.dir_to_wallmounted(dir)
-^ Convert a vector to a wallmounted value, used for paramtype2="wallmounted"
-minetest.get_node_drops(nodename, toolname)
-^ Returns list of item names.
-^ Note: This will be removed or modified in a future version.
-minetest.get_craft_result(input) -> output, decremented_input
-^ input.method = 'normal' or 'cooking' or 'fuel'
-^ input.width = for example 3
-^ input.items = for example { stack 1, stack 2, stack 3, stack 4,
- stack 5, stack 6, stack 7, stack 8, stack 9 }
-^ output.item = ItemStack, if unsuccessful: empty ItemStack
-^ output.time = number, if unsuccessful: 0
-^ decremented_input = like input
-minetest.get_craft_recipe(output) -> input
-^ returns last registered recipe for output item (node)
-^ output is a node or item type such as 'default:torch'
-^ input.method = 'normal' or 'cooking' or 'fuel'
-^ input.width = for example 3
-^ input.items = for example { stack 1, stack 2, stack 3, stack 4,
- stack 5, stack 6, stack 7, stack 8, stack 9 }
-^ input.items = nil if no recipe found
-minetest.get_all_craft_recipes(query item) -> table or nil
-^ returns indexed table with all registered recipes for query item (node)
- or nil if no recipe was found
- recipe entry table:
- {
- method = 'normal' or 'cooking' or 'fuel'
- width = 0-3, 0 means shapeless recipe
- items = indexed [1-9] table with recipe items
- output = string with item name and quantity
- }
- Example query for default:gold_ingot will return table:
- {
- 1={type = "cooking", width = 3, output = "default:gold_ingot",
- items = {1 = "default:gold_lump"}},
- 2={type = "normal", width = 1, output = "default:gold_ingot 9",
- items = {1 = "default:goldblock"}}
- }
-minetest.handle_node_drops(pos, drops, digger)
-^ drops: list of itemstrings
-^ Handles drops from nodes after digging: Default action is to put them into
- digger's inventory
-^ Can be overridden to get different functionality (eg. dropping items on
- ground)
-
-Rollbacks:
-minetest.rollback_get_last_node_actor(p, range, seconds) -> actor, p, seconds
-^ Find who has done something to a node, or near a node
-^ actor: "player:<name>", also "liquid".
-minetest.rollback_revert_actions_by(actor, seconds) -> bool, log messages
-^ Revert latest actions of someone
-^ actor: "player:<name>", also "liquid".
-
-Defaults for the on_* item definition functions:
-(These return the leftover itemstack)
-minetest.item_place_node(itemstack, placer, pointed_thing)
-^ Place item as a node
-minetest.item_place_object(itemstack, placer, pointed_thing)
-^ Place item as-is
-minetest.item_place(itemstack, placer, pointed_thing)
-^ Use one of the above based on what the item is.
-^ Calls on_rightclick of pointed_thing.under if defined instead
-^ Note: is not called when wielded item overrides on_place
-minetest.item_drop(itemstack, dropper, pos)
-^ Drop the item
-minetest.item_eat(hp_change, replace_with_item)
-^ Eat the item. replace_with_item can be nil.
-
-Defaults for the on_punch and on_dig node definition callbacks:
-minetest.node_punch(pos, node, puncher)
-^ Calls functions registered by minetest.register_on_punchnode()
-minetest.node_dig(pos, node, digger)
-^ Checks if node can be dug, puts item into inventory, removes node
-^ Calls functions registered by minetest.registered_on_dignodes()
-
-Sounds:
-minetest.sound_play(spec, parameters) -> handle
-^ spec = SimpleSoundSpec
-^ parameters = sound parameter table
-minetest.sound_stop(handle)
-
-Timing:
-minetest.after(time, func, ...)
-^ Call function after time seconds
-^ Optional: Variable number of arguments that are passed to func
-
-Server:
-minetest.request_shutdown() -> request for server shutdown
-minetest.get_server_status() -> server status string
-
-Bans:
-minetest.get_ban_list() -> ban list (same as minetest.get_ban_description(""))
-minetest.get_ban_description(ip_or_name) -> ban description (string)
-minetest.ban_player(name) -> ban a player
-minetest.unban_player_or_ip(name) -> unban player or IP address
-
-Particles:
-minetest.add_particle(pos, velocity, acceleration, expirationtime,
- size, collisiondetection, texture, playername)
-^ Spawn particle at pos with velocity and acceleration
-^ Disappears after expirationtime seconds
-^ collisiondetection: if true collides with physical objects
-^ Uses texture (string)
-^ Playername is optional, if specified spawns particle only on the player's client
-
-minetest.add_particlespawner(amount, time,
- minpos, maxpos,
- minvel, maxvel,
- minacc, maxacc,
- minexptime, maxexptime,
- minsize, maxsize,
- collisiondetection, texture, playername)
-^ Add a particlespawner, an object that spawns an amount of particles over time seconds
-^ The particle's properties are random values in between the boundings:
-^ minpos/maxpos, minvel/maxvel (velocity), minacc/maxacc (acceleration),
-^ minsize/maxsize, minexptime/maxexptime (expirationtime)
-^ collisiondetection: if true uses collisiondetection
-^ Uses texture (string)
-^ Playername is optional, if specified spawns particle only on the player's client
-^ If time is 0 has infinite lifespan and spawns the amount on a per-second base
-^ Returns and id
-
-minetest.delete_particlespawner(id, player)
-^ Delete ParticleSpawner with id (return value from add_particlespawner)
-^ If playername is specified, only deletes on the player's client,
-^ otherwise on all clients
-
-Schematics:
-minetest.create_schematic(p1, p2, probability_list, filename)
-^ Create a schematic from the volume of map specified by the box formed by p1 and p2.
-^ Apply the specified probability values to the specified nodes in probability_list.
- ^ probability_list is an array of tables containing two fields, pos and prob.
- ^ pos is the 3d vector specifying the absolute coordinates of the node being modified,
- ^ and prob is the integer value from 0 to 255 of the probability (see: Schematic specifier).
- ^ If there are two or more entries with the same pos value, the last occuring in the array is used.
- ^ If pos is not inside the box formed by p1 and p2, it is ignored.
- ^ If probability_list is nil, no probabilities are applied.
-^ Saves schematic in the Minetest Schematic format to filename.
-
-minetest.place_schematic(pos, schematic, rotation, replacements)
-^ Place the schematic specified by schematic (see: Schematic specifier) at pos.
-^ Rotation can be "0", "90", "180", "270", or "random".
-^ If the rotation parameter is omitted, the schematic is not rotated.
-^ replacements = {{"oldname", "convert_to"}, ...}
-
-Random:
-minetest.get_connected_players() -> list of ObjectRefs
-minetest.hash_node_position({x=,y=,z=}) -> 48-bit integer
-^ Gives a unique hash number for a node position (16+16+16=48bit)
-minetest.get_item_group(name, group) -> rating
-^ Get rating of a group of an item. (0 = not in group)
-minetest.get_node_group(name, group) -> rating
-^ Deprecated: An alias for the former.
-minetest.get_content_id(name) -> integer
-^ Gets the internal content ID of name
-minetest.get_name_from_content_id(content_id) -> string
-^ Gets the name of the content with that content ID
-minetest.parse_json(string[, nullvalue]) -> something
-^ Convert a string containing JSON data into the Lua equivalent
-^ nullvalue: returned in place of the JSON null; defaults to nil
-^ On success returns a table, a string, a number, a boolean or nullvalue
-^ On failure outputs an error message and returns nil
-^ Example: parse_json("[10, {\"a\":false}]") -> {[1] = 10, [2] = {a = false}}
-minetest.serialize(table) -> string
-^ Convert a table containing tables, strings, numbers, booleans and nils
- into string form readable by minetest.deserialize
-^ Example: serialize({foo='bar'}) -> 'return { ["foo"] = "bar" }'
-minetest.deserialize(string) -> table
-^ Convert a string returned by minetest.deserialize into a table
-^ String is loaded in an empty sandbox environment.
-^ Will load functions, but they cannot access the global environment.
-^ Example: deserialize('return { ["foo"] = "bar" }') -> {foo='bar'}
-^ Example: deserialize('print("foo")') -> nil (function call fails)
- ^ error:[string "print("foo")"]:1: attempt to call global 'print' (a nil value)
-
-Global objects:
-minetest.env - EnvRef of the server environment and world.
-^ Any function in the minetest namespace can be called using the syntax
- minetest.env:somefunction(somearguments)
- instead of
- minetest.somefunction(somearguments)
-^ Deprecated, but support is not to be dropped soon
-
-Global tables:
-minetest.registered_items
-^ List of registered items, indexed by name
-minetest.registered_nodes
-^ List of registered node definitions, indexed by name
-minetest.registered_craftitems
-^ List of registered craft item definitions, indexed by name
-minetest.registered_tools
-^ List of registered tool definitions, indexed by name
-minetest.registered_entities
-^ List of registered entity prototypes, indexed by name
-minetest.object_refs
-^ List of object references, indexed by active object id
-minetest.luaentities
-^ List of lua entities, indexed by active object id
+* `dump2(obj, name="_", dumped={})`
+ * Return object serialized as a string, handles reference loops
+* `dump(obj, dumped={})`
+ * Return object serialized as a string
+* `math.hypot(x, y)`
+ * Get the hypotenuse of a triangle with legs x and y.
+ Useful for distance calculation.
+* `math.sign(x, tolerance)`
+ * Get the sign of a number.
+ Optional: Also returns `0` when the absolute value is within the tolerance (default: `0`)
+* `string.split(str, separator=",", include_empty=false, max_splits=-1,
+* sep_is_pattern=false)`
+ * If `max_splits` is negative, do not limit splits.
+ * `sep_is_pattern` specifies if separator is a plain string or a pattern (regex).
+ * e.g. `string:split("a,b", ",") == {"a","b"}`
+* `string:trim()`
+ * e.g. `string.trim("\n \t\tfoo bar\t ") == "foo bar"`
+* `minetest.pos_to_string({x=X,y=Y,z=Z})`: returns `"(X,Y,Z)"`
+ * Convert position to a printable string
+* `minetest.string_to_pos(string)`: returns a position
+ * Same but in reverse. Returns `nil` if the string can't be parsed to a position.
+* `minetest.string_to_area("(X1, Y1, Z1) (X2, Y2, Z2)")`: returns two positions
+ * Converts a string representing an area box into two positions
+* `minetest.formspec_escape(string)`: returns a string
+ * escapes the characters "[", "]", "\", "," and ";", which can not be used in formspecs
+* `minetest.is_yes(arg)`
+ * returns whether `arg` can be interpreted as yes
+* `minetest.get_us_time()`
+ * returns time with microsecond precision
+* `table.copy(table)`: returns a table
+ * returns a deep copy of `table`
+
+`minetest` namespace reference
+------------------------------
+
+### Utilities
+
+* `minetest.get_current_modname()`: returns the currently loading mod's name, when we are loading a mod
+* `minetest.get_modpath(modname)`: returns e.g. `"/home/user/.minetest/usermods/modname"`
+ * Useful for loading additional `.lua` modules or static data from mod
+* `minetest.get_modnames()`: returns a list of installed mods
+ * Return a list of installed mods, sorted alphabetically
+* `minetest.get_worldpath()`: returns e.g. `"/home/user/.minetest/world"`
+ * Useful for storing custom data
+* `minetest.is_singleplayer()`
+* `minetest.features`
+ * Table containing API feature flags: `{foo=true, bar=true}`
+* `minetest.has_feature(arg)`: returns `boolean, missing_features`
+ * `arg`: string or table in format `{foo=true, bar=true}`
+ * `missing_features`: `{foo=true, bar=true}`
+* `minetest.get_player_information(player_name)`: returns a table containing
+ information about player. Example return value:
+ {
+ address = "127.0.0.1", -- IP address of client
+ ip_version = 4, -- IPv4 / IPv6
+ min_rtt = 0.01, -- minimum round trip time
+ max_rtt = 0.2, -- maximum round trip time
+ avg_rtt = 0.02, -- average round trip time
+ min_jitter = 0.01, -- minimum packet time jitter
+ max_jitter = 0.5, -- maximum packet time jitter
+ avg_jitter = 0.03, -- average packet time jitter
+ connection_uptime = 200, -- seconds since client connected
+
+ -- following information is available on debug build only!!!
+ -- DO NOT USE IN MODS
+ --ser_vers = 26, -- serialization version used by client
+ --prot_vers = 23, -- protocol version used by client
+ --major = 0, -- major version number
+ --minor = 4, -- minor version number
+ --patch = 10, -- patch version number
+ --vers_string = "0.4.9-git", -- full version string
+ --state = "Active" -- current client state
+ }
+* `minetest.mkdir(path)`: returns success.
+ * Creates a directory specified by `path`, creating parent directories
+ if they don't exist.
+* `minetest.get_dir_list(path, [is_dir])`: returns list of entry names
+ * is_dir is one of:
+ * nil: return all entries,
+ * true: return only subdirectory names, or
+ * false: return only file names.
+
+### Logging
+* `minetest.debug(...)`
+ * Equivalent to `minetest.log(table.concat({...}, "\t"))`
+* `minetest.log([level,] text)`
+ * `level` is one of `"none"`, `"error"`, `"warning"`, `"action"`,
+ `"info"`, or `"verbose"`. Default is `"none"`.
+
+### Registration functions
+Call these functions only at load time!
+
+* `minetest.register_entity(name, prototype table)`
+* `minetest.register_abm(abm definition)`
+* `minetest.register_node(name, node definition)`
+* `minetest.register_tool(name, item definition)`
+* `minetest.register_craftitem(name, item definition)`
+* `minetest.register_alias(name, convert_to)`
+* `minetest.register_craft(recipe)`
+* `minetest.register_ore(ore definition)`
+* `minetest.register_decoration(decoration definition)`
+* `minetest.override_item(name, redefinition)`
+ * Overrides fields of an item registered with register_node/tool/craftitem.
+ * Note: Item must already be defined, (opt)depend on the mod defining it.
+ * Example: `minetest.override_item("default:mese", {light_source=LIGHT_MAX})`
+
+* `minetest.clear_registered_ores()`
+* `minetest.clear_registered_decorations()`
+
+### Global callback registration functions
+Call these functions only at load time!
+
+* `minetest.register_globalstep(func(dtime))`
+ * Called every server step, usually interval of 0.1s
+* `minetest.register_on_shutdown(func())`
+ * Called before server shutdown
+ * **Warning**: If the server terminates abnormally (i.e. crashes), the registered
+ callbacks **will likely not be run**. Data should be saved at
+ semi-frequent intervals as well as on server shutdown.
+* `minetest.register_on_placenode(func(pos, newnode, placer, oldnode, itemstack, pointed_thing))`
+ * Called when a node has been placed
+ * If return `true` no item is taken from `itemstack`
+ * **Not recommended**; use `on_construct` or `after_place_node` in node definition
+ whenever possible
+* `minetest.register_on_dignode(func(pos, oldnode, digger))`
+ * Called when a node has been dug.
+ * **Not recommended**; Use `on_destruct` or `after_dig_node` in node definition
+ whenever possible
+* `minetest.register_on_punchnode(func(pos, node, puncher, pointed_thing))`
+ * Called when a node is punched
+* `minetest.register_on_generated(func(minp, maxp, blockseed))`
+ * Called after generating a piece of world. Modifying nodes inside the area
+ is a bit faster than usually.
+* `minetest.register_on_newplayer(func(ObjectRef))`
+ * Called after a new player has been created
+* `minetest.register_on_dieplayer(func(ObjectRef))`
+ * Called when a player dies
+* `minetest.register_on_punchplayer(func(player, hitter, time_from_last_punch, tool_capabilities, dir, damage))`
+ * Called when a player is punched
+ * `player` - ObjectRef - Player that was punched
+ * `hitter` - ObjectRef - Player that hit
+ * `time_from_last_punch`: Meant for disallowing spamming of clicks (can be nil)
+ * `tool_capabilities`: capability table of used tool (can be nil)
+ * `dir`: unit vector of direction of punch. Always defined. Points from
+ the puncher to the punched.
+ * `damage` - number that represents the damage calculated by the engine
+ * should return `true` to prevent the default damage mechanism
+* `minetest.register_on_player_hpchange(func(player, hp_change), modifier)`
+ * Called when the player gets damaged or healed
+ * `player`: ObjectRef of the player
+ * `hp_change`: the amount of change. Negative when it is damage.
+ * `modifier`: when true, the function should return the actual hp_change.
+ Note: modifiers only get a temporary hp_change that can be modified by later modifiers.
+ modifiers can return true as a second argument to stop the execution of further functions.
+* `minetest.register_on_respawnplayer(func(ObjectRef))`
+ * Called when player is to be respawned
+ * Called _before_ repositioning of player occurs
+ * return true in func to disable regular player placement
+* `minetest.register_on_prejoinplayer(func(name, ip))`
+ * Called before a player joins the game
+ * If it returns a string, the player is disconnected with that string as reason
+* `minetest.register_on_joinplayer(func(ObjectRef))`
+ * Called when a player joins the game
+* `minetest.register_on_leaveplayer(func(ObjectRef))`
+ * Called when a player leaves the game
+* `minetest.register_on_cheat(func(ObjectRef, cheat))`
+ * Called when a player cheats
+ * `cheat`: `{type=<cheat_type>}`, where `<cheat_type>` is one of:
+ * `"moved_too_fast"`
+ * `"interacted_too_far"`
+ * `"finished_unknown_dig"`
+ * `dug_unbreakable`
+ * `dug_too_fast`
+* `minetest.register_on_chat_message(func(name, message))`
+ * Called always when a player says something
+ * Return `true` to mark the message as handled, which means that it will not be sent to other players
+* `minetest.register_on_player_receive_fields(func(player, formname, fields))`
+ * Called when a button is pressed in player's inventory form
+ * Newest functions are called first
+ * If function returns `true`, remaining functions are not called
+* `minetest.register_on_craft(func(itemstack, player, old_craft_grid, craft_inv))`
+ * Called when `player` crafts something
+ * `itemstack` is the output
+ * `old_craft_grid` contains the recipe (Note: the one in the inventory is cleared)
+ * `craft_inv` is the inventory with the crafting grid
+ * Return either an `ItemStack`, to replace the output, or `nil`, to not modify it
+* `minetest.register_craft_predict(func(itemstack, player, old_craft_grid, craft_inv))`
+ * The same as before, except that it is called before the player crafts, to make
+ craft prediction, and it should not change anything.
+* `minetest.register_on_protection_violation(func(pos, name))`
+ * Called by `builtin` and mods when a player violates protection at a position
+ (eg, digs a node or punches a protected entity).
+ * The registered functions can be called using `minetest.record_protection_violation`
+ * The provided function should check that the position is protected by the mod
+ calling this function before it prints a message, if it does, to allow for
+ multiple protection mods.
+* `minetest.register_on_item_eat(func(hp_change, replace_with_item, itemstack, user, pointed_thing))`
+ * Called when an item is eaten, by `minetest.item_eat`
+ * Return `true` or `itemstack` to cancel the default item eat response (i.e.: hp increase)
+
+### Other registration functions
+* `minetest.register_chatcommand(cmd, chatcommand definition)`
+* `minetest.register_privilege(name, definition)`
+ * `definition`: `"description text"`
+ * `definition`: `{ description = "description text", give_to_singleplayer = boolean, -- default: true }`
+* `minetest.register_authentication_handler(handler)`
+ * See `minetest.builtin_auth_handler` in `builtin.lua` for reference
+
+### Setting-related
+* `minetest.setting_set(name, value)`
+ * Setting names can't contain whitespace or any of `="{}#`.
+ * Setting values can't contain the sequence `\n"""`.
+ * Setting names starting with "secure." can't be set.
+* `minetest.setting_get(name)`: returns string or `nil`
+* `minetest.setting_setbool(name, value)`
+ * See documentation on `setting_set` for restrictions.
+* `minetest.setting_getbool(name)`: returns boolean or `nil`
+* `minetest.setting_get_pos(name)`: returns position or nil
+* `minetest.setting_save()`, returns `nil`, save all settings to config file
+
+### Authentication
+* `minetest.notify_authentication_modified(name)`
+ * Should be called by the authentication handler if privileges changes.
+ * To report everybody, set `name=nil`.
+* `minetest.get_password_hash(name, raw_password)`
+ * Convert a name-password pair to a password hash that Minetest can use.
+ * The returned value alone is not a good basis for password checks based
+ * on comparing the password hash in the database with the password hash
+ * from the function, with an externally provided password, as the hash
+ * in the db might use the new SRP verifier format.
+* `minetest.string_to_privs(str)`: returns `{priv1=true,...}`
+* `minetest.privs_to_string(privs)`: returns `"priv1,priv2,..."`
+ * Convert between two privilege representations
+* `minetest.set_player_password(name, password_hash)`
+* `minetest.set_player_privs(name, {priv1=true,...})`
+* `minetest.get_player_privs(name) -> {priv1=true,...}`
+* `minetest.auth_reload()`
+* `minetest.check_player_privs(player_or_name, ...)`: returns `bool, missing_privs`
+ * A quickhand for checking privileges.
+ * `player_or_name`: Either a Player object or the name of a player.
+ * `...` is either a list of strings, e.g. `"priva", "privb"` or
+ a table, e.g. `{ priva = true, privb = true }`.
+* `minetest.get_player_ip(name)`: returns an IP address string
+
+`minetest.set_player_password`, `minetest_set_player_privs`, `minetest_get_player_privs`
+and `minetest.auth_reload` call the authetification handler.
+
+### Chat
+* `minetest.chat_send_all(text)`
+* `minetest.chat_send_player(name, text)`
+
+### Environment access
+* `minetest.set_node(pos, node)`
+* `minetest.add_node(pos, node): alias set_node(pos, node)`
+ * Set node at position (`node = {name="foo", param1=0, param2=0}`)
+* `minetest.swap_node(pos, node`
+ * Set node at position, but don't remove metadata
+* `minetest.remove_node(pos)`
+ * Equivalent to `set_node(pos, "air")`
+* `minetest.get_node(pos)`
+ * Returns `{name="ignore", ...}` for unloaded area
+* `minetest.get_node_or_nil(pos)`
+ * Returns `nil` for unloaded area
+* `minetest.get_node_light(pos, timeofday)`
+ * Gets the light value at the given position. Note that the light value
+ "inside" the node at the given position is returned, so you usually want
+ to get the light value of a neighbor.
+ * `pos`: The position where to measure the light.
+ * `timeofday`: `nil` for current time, `0` for night, `0.5` for day
+ * Returns a number between `0` and `15` or `nil`
+* `minetest.place_node(pos, node)`
+ * Place node with the same effects that a player would cause
+* `minetest.dig_node(pos)`
+ * Dig node with the same effects that a player would cause
+ * Returns `true` if successful, `false` on failure (e.g. protected location)
+* `minetest.punch_node(pos)`
+ * Punch node with the same effects that a player would cause
+
+* `minetest.find_nodes_with_meta(pos1, pos2)`
+ * Get a table of positions of nodes that have metadata within a region {pos1, pos2}
+* `minetest.get_meta(pos)`
+ * Get a `NodeMetaRef` at that position
+* `minetest.get_node_timer(pos)`
+ * Get `NodeTimerRef`
+
+* `minetest.add_entity(pos, name)`: Spawn Lua-defined entity at position
+ * Returns `ObjectRef`, or `nil` if failed
+* `minetest.add_item(pos, item)`: Spawn item
+ * Returns `ObjectRef`, or `nil` if failed
+* `minetest.get_player_by_name(name)`: Get an `ObjectRef` to a player
+* `minetest.get_objects_inside_radius(pos, radius)`
+ * `radius`: using an euclidean metric
+* `minetest.set_timeofday(val)`
+ * `val` is between `0` and `1`; `0` for midnight, `0.5` for midday
+* `minetest.get_timeofday()`
+* `minetest.get_gametime()`: returns the time, in seconds, since the world was created
+* `minetest.find_node_near(pos, radius, nodenames)`: returns pos or `nil`
+ * `radius`: using a maximum metric
+ * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
+* `minetest.find_nodes_in_area(minp, maxp, nodenames)`: returns a list of positions
+ * returns as second value a table with the count of the individual nodes found
+ * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
+* `minetest.find_nodes_in_area_under_air(minp, maxp, nodenames)`: returns a list of positions
+ * returned positions are nodes with a node air above
+ * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
+* `minetest.get_perlin(noiseparams)`
+* `minetest.get_perlin(seeddiff, octaves, persistence, scale)`
+ * Return world-specific perlin noise (`int(worldseed)+seeddiff`)
+* `minetest.get_voxel_manip([pos1, pos2])`
+ * Return voxel manipulator object.
+ * Loads the manipulator from the map if positions are passed.
+* `minetest.set_gen_notify(flags, {deco_ids})`
+ * Set the types of on-generate notifications that should be collected
+ * `flags` is a flag field with the available flags: `dungeon`, `temple`, `cave_begin`,
+ `cave_end`, `large_cave_begin`, `large_cave_end`, `decoration`
+ * The second parameter is a list of IDS of decorations which notification is requested for
+* `get_gen_notify()`: returns a flagstring and a table with the deco_ids
+* `minetest.get_mapgen_object(objectname)`
+ * Return requested mapgen object if available (see "Mapgen objects")
+* `minetest.get_biome_id(biome_name)`
+ * Returns the biome id, as used in the biomemap Mapgen object, for a
+ given biome_name string.
+* `minetest.get_mapgen_params()` Returns mapgen parameters, a table containing
+ `mgname`, `seed`, `chunksize`, `water_level`, and `flags`.
+* `minetest.set_mapgen_params(MapgenParams)`
+ * Set map generation parameters
+ * Function cannot be called after the registration period; only initialization
+ and `on_mapgen_init`
+ * Takes a table as an argument with the fields `mgname`, `seed`, `water_level`,
+ and `flags`.
+ * Leave field unset to leave that parameter unchanged
+ * `flags` contains a comma-delimited string of flags to set,
+ or if the prefix `"no"` is attached, clears instead.
+ * `flags` is in the same format and has the same options as `mg_flags` in `minetest.conf`
+* `minetest.set_noiseparams(name, noiseparams, set_default)`
+ * Sets the noiseparams setting of `name` to the noiseparams table specified in `noiseparams`.
+ * `set_default` is an optional boolean (default: `true`) that specifies whether the setting
+ should be applied to the default config or current active config
+* `minetest.get_noiseparams(name)`: returns a table of the noiseparams for name
+* `minetest.generate_ores(vm, pos1, pos2)`
+ * Generate all registered ores within the VoxelManip `vm` and in the area from `pos1` to `pos2`.
+ * `pos1` and `pos2` are optional and default to mapchunk minp and maxp.
+* `minetest.generate_decorations(vm, pos1, pos2)`
+ * Generate all registered decorations within the VoxelManip `vm` and in the area from `pos1` to `pos2`.
+ * `pos1` and `pos2` are optional and default to mapchunk minp and maxp.
+* `minetest.clear_objects()`
+ * clear all objects in the environments
+* `minetest.emerge_area(pos1, pos2, [callback], [param])`
+ * Queue all blocks in the area from `pos1` to `pos2`, inclusive, to be asynchronously
+ * fetched from memory, loaded from disk, or if inexistent, generates them.
+ * If `callback` is a valid Lua function, this will be called for each block emerged.
+ * The function signature of callback is:
+ * `function EmergeAreaCallback(blockpos, action, calls_remaining, param)`
+ * - `blockpos` is the *block* coordinates of the block that had been emerged
+ * - `action` could be one of the following constant values:
+ * `core.EMERGE_CANCELLED`, `core.EMERGE_ERRORED`, `core.EMERGE_FROM_MEMORY`,
+ * `core.EMERGE_FROM_DISK`, `core.EMERGE_GENERATED`
+ * - `calls_remaining` is the number of callbacks to be expected after this one
+ * - `param` is the user-defined parameter passed to emerge_area (or nil if the
+ * parameter was absent)
+* `minetest.delete_area(pos1, pos2)`
+ * delete all mapblocks in the area from pos1 to pos2, inclusive
+* `minetest.line_of_sight(pos1, pos2, stepsize)`: returns `boolean, pos`
+ * Check if there is a direct line of sight between `pos1` and `pos2`
+ * Returns the position of the blocking node when `false`
+ * `pos1`: First position
+ * `pos2`: Second position
+ * `stepsize`: smaller gives more accurate results but requires more computing
+ time. Default is `1`.
+* `minetest.find_path(pos1,pos2,searchdistance,max_jump,max_drop,algorithm)`
+ * returns table containing path
+ * returns a table of 3D points representing a path from `pos1` to `pos2` or `nil`
+ * `pos1`: start position
+ * `pos2`: end position
+ * `searchdistance`: number of blocks to search in each direction using a maximum metric
+ * `max_jump`: maximum height difference to consider walkable
+ * `max_drop`: maximum height difference to consider droppable
+ * `algorithm`: One of `"A*_noprefetch"` (default), `"A*"`, `"Dijkstra"`
+* `minetest.spawn_tree (pos, {treedef})`
+ * spawns L-System tree at given `pos` with definition in `treedef` table
+* `minetest.transforming_liquid_add(pos)`
+ * add node to liquid update queue
+* `minetest.get_node_max_level(pos)`
+ * get max available level for leveled node
+* `minetest.get_node_level(pos)`
+ * get level of leveled node (water, snow)
+* `minetest.set_node_level(pos, level)`
+ * set level of leveled node, default `level` equals `1`
+ * if `totallevel > maxlevel`, returns rest (`total-max`).
+* `minetest.add_node_level(pos, level)`
+ * increase level of leveled node by level, default `level` equals `1`
+ * if `totallevel > maxlevel`, returns rest (`total-max`)
+ * can be negative for decreasing
+
+### Inventory
+`minetest.get_inventory(location)`: returns an `InvRef`
+
+* `location` = e.g.
+ * `{type="player", name="celeron55"}`
+ * `{type="node", pos={x=, y=, z=}}`
+ * `{type="detached", name="creative"}`
+* `minetest.create_detached_inventory(name, callbacks)`: returns an `InvRef`
+ * callbacks: See "Detached inventory callbacks"
+ * Creates a detached inventory. If it already exists, it is cleared.
+* `minetest.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)`:
+ returns left over ItemStack
+ * See `minetest.item_eat` and `minetest.register_on_item_eat`
+
+### Formspec
+* `minetest.show_formspec(playername, formname, formspec)`
+ * `playername`: name of player to show formspec
+ * `formname`: name passed to `on_player_receive_fields` callbacks.
+ It should follow the `"modname:<whatever>"` naming convention
+ * `formspec`: formspec to display
+* `minetest.formspec_escape(string)`: returns a string
+ * escapes the characters "[", "]", "\", "," and ";", which can not be used in formspecs
+* `minetest.explode_table_event(string)`: returns a table
+ * returns e.g. `{type="CHG", row=1, column=2}`
+ * `type` is one of:
+ * `"INV"`: no row selected)
+ * `"CHG"`: selected)
+ * `"DCL"`: double-click
+* `minetest.explode_textlist_event(string)`: returns a table
+ * returns e.g. `{type="CHG", index=1}`
+ * `type` is one of:
+ * `"INV"`: no row selected)
+ * `"CHG"`: selected)
+ * `"DCL"`: double-click
+* `minetest.explode_scrollbar_event(string)`: returns a table
+ * returns e.g. `{type="CHG", value=500}`
+ * `type` is one of:
+ * `"INV"`: something failed
+ * `"CHG"`: has been changed
+ * `"VAL"`: not changed
+
+### Item handling
+* `minetest.inventorycube(img1, img2, img3)`
+ * Returns a string for making an image of a cube (useful as an item image)
+* `minetest.get_pointed_thing_position(pointed_thing, above)`
+ * Get position of a `pointed_thing` (that you can get from somewhere)
+* `minetest.dir_to_facedir(dir, is6d)`
+ * Convert a vector to a facedir value, used in `param2` for `paramtype2="facedir"`;
+ * passing something non-`nil`/`false` for the optional second parameter causes it to
+ take the y component into account
+* `minetest.facedir_to_dir(facedir)`
+ * Convert a facedir back into a vector aimed directly out the "back" of a node
+* `minetest.dir_to_wallmounted(dir)`
+ * Convert a vector to a wallmounted value, used for `paramtype2="wallmounted"`
+* `minetest.get_node_drops(nodename, toolname)`
+ * Returns list of item names.
+ * **Note**: This will be removed or modified in a future version.
+* `minetest.get_craft_result(input)`: returns `output, decremented_input`
+ * `input.method` = `"normal"` or `"cooking"` or `"fuel"`
+ * `input.width` = for example `3`
+ * `input.items` = for example
+ `{ stack1, stack2, stack3, stack4, stack 5, stack 6, stack 7, stack 8, stack 9 }`
+ * `output.item` = `ItemStack`, if unsuccessful: empty `ItemStack`
+ * `output.time` = a number, if unsuccessful: `0`
+ * `output.replacements` = list of `ItemStack`s that couldn't be placed in
+ `decremented_input.items`
+ * `decremented_input` = like `input`
+* `minetest.get_craft_recipe(output)`: returns input
+ * returns last registered recipe for output item (node)
+ * `output` is a node or item type such as `"default:torch"`
+ * `input.method` = `"normal"` or `"cooking"` or `"fuel"`
+ * `input.width` = for example `3`
+ * `input.items` = for example
+ `{ stack1, stack2, stack3, stack4, stack 5, stack 6, stack 7, stack 8, stack 9 }`
+ * `input.items` = `nil` if no recipe found
+* `minetest.get_all_craft_recipes(query item)`: returns a table or `nil`
+ * returns indexed table with all registered recipes for query item (node)
+ or `nil` if no recipe was found
+ * recipe entry table:
+ {
+ method = 'normal' or 'cooking' or 'fuel'
+ width = 0-3, 0 means shapeless recipe
+ items = indexed [1-9] table with recipe items
+ output = string with item name and quantity
+ }
+ * Example query for `"default:gold_ingot"` will return table:
+ {
+ [1]={type = "cooking", width = 3, output = "default:gold_ingot",
+ items = {1 = "default:gold_lump"}},
+ [2]={type = "normal", width = 1, output = "default:gold_ingot 9",
+ items = {1 = "default:goldblock"}}
+ }
+* `minetest.handle_node_drops(pos, drops, digger)`
+ * `drops`: list of itemstrings
+ * Handles drops from nodes after digging: Default action is to put them into
+ digger's inventory
+ * Can be overridden to get different functionality (e.g. dropping items on
+ ground)
+
+### Rollback
+* `minetest.rollback_get_node_actions(pos, range, seconds, limit)`:
+ returns `{{actor, pos, time, oldnode, newnode}, ...}`
+ * Find who has done something to a node, or near a node
+ * `actor`: `"player:<name>"`, also `"liquid"`.
+* `minetest.rollback_revert_actions_by(actor, seconds)`: returns `boolean, log_messages`
+ * Revert latest actions of someone
+ * `actor`: `"player:<name>"`, also `"liquid"`.
+
+### Defaults for the `on_*` item definition functions
+These functions return the leftover itemstack.
+
+* `minetest.item_place_node(itemstack, placer, pointed_thing, param2)`
+ * Place item as a node
+ * `param2` overrides `facedir` and wallmounted `param2`
+ * returns `itemstack, success`
+* `minetest.item_place_object(itemstack, placer, pointed_thing)`
+ * Place item as-is
+* `minetest.item_place(itemstack, placer, pointed_thing, param2)`
+ * Use one of the above based on what the item is.
+ * Calls `on_rightclick` of `pointed_thing.under` if defined instead
+ * **Note**: is not called when wielded item overrides `on_place`
+ * `param2` overrides `facedir` and wallmounted `param2`
+ * returns `itemstack, success`
+* `minetest.item_drop(itemstack, dropper, pos)`
+ * Drop the item
+* `minetest.item_eat(hp_change, replace_with_item)`
+ * Eat the item.
+ * `replace_with_item` is the itemstring which is added to the inventory.
+ If the player is eating a stack, then replace_with_item goes to a
+ different spot. Can be `nil`
+ * See `minetest.do_item_eat`
+
+### Defaults for the `on_punch` and `on_dig` node definition callbacks
+* `minetest.node_punch(pos, node, puncher, pointed_thing)`
+ * Calls functions registered by `minetest.register_on_punchnode()`
+* `minetest.node_dig(pos, node, digger)`
+ * Checks if node can be dug, puts item into inventory, removes node
+ * Calls functions registered by `minetest.registered_on_dignodes()`
+
+### Sounds
+* `minetest.sound_play(spec, parameters)`: returns a handle
+ * `spec` is a `SimpleSoundSpec`
+ * `parameters` is a sound parameter table
+* `minetest.sound_stop(handle)`
+
+### Timing
+* `minetest.after(time, func, ...)`
+ * Call the function `func` after `time` seconds
+ * Optional: Variable number of arguments that are passed to `func`
+
+### Server
+* `minetest.request_shutdown([message],[reconnect])`: request for server shutdown. Will display `message` to clients,
+ and `reconnect` == true displays a reconnect button.
+* `minetest.get_server_status()`: returns server status string
+
+### Bans
+* `minetest.get_ban_list()`: returns the ban list (same as `minetest.get_ban_description("")`)
+* `minetest.get_ban_description(ip_or_name)`: returns ban description (string)
+* `minetest.ban_player(name)`: ban a player
+* `minetest.unban_player_or_ip(name)`: unban player or IP address
+* `minetest.kick_player(name, [reason])`: disconnect a player with a optional reason
+
+### Particles
+* `minetest.add_particle(particle definition)`
+ * Deprecated: `minetest.add_particle(pos, velocity, acceleration, expirationtime,
+ size, collisiondetection, texture, playername)`
+
+* `minetest.add_particlespawner(particlespawner definition)`
+ * Add a `ParticleSpawner`, an object that spawns an amount of particles over `time` seconds
+ * Returns an `id`, and -1 if adding didn't succeed
+ * `Deprecated: minetest.add_particlespawner(amount, time,
+ minpos, maxpos,
+ minvel, maxvel,
+ minacc, maxacc,
+ minexptime, maxexptime,
+ minsize, maxsize,
+ collisiondetection, texture, playername)`
+
+* `minetest.delete_particlespawner(id, player)``
+ * Delete `ParticleSpawner` with `id` (return value from `minetest.add_particlespawner`)
+ * If playername is specified, only deletes on the player's client,
+ * otherwise on all clients
+
+### Schematics
+* `minetest.create_schematic(p1, p2, probability_list, filename, slice_prob_list)`
+ * Create a schematic from the volume of map specified by the box formed by p1 and p2.
+ * Apply the specified probability values to the specified nodes in `probability_list`.
+ * `probability_list` is an array of tables containing two fields, `pos` and `prob`.
+ * `pos` is the 3D vector specifying the absolute coordinates of the
+ node being modified,
+ * `prob` is the integer value from `0` to `255` of the probability (see: Schematic specifier).
+ * If there are two or more entries with the same pos value, the
+ last entry is used.
+ * If `pos` is not inside the box formed by `p1` and `p2`, it is ignored.
+ * If `probability_list` equals `nil`, no probabilities are applied.
+ * Slice probability works in the same manner, except takes a field
+ called `ypos` instead which
+ indicates the y position of the slice with a probability applied.
+ * If slice probability list equals `nil`, no slice probabilities are applied.
+ * Saves schematic in the Minetest Schematic format to filename.
+
+* `minetest.place_schematic(pos, schematic, rotation, replacements, force_placement)`
+ * Place the schematic specified by schematic (see: Schematic specifier) at `pos`.
+ * `rotation` can equal `"0"`, `"90"`, `"180"`, `"270"`, or `"random"`.
+ * If the `rotation` parameter is omitted, the schematic is not rotated.
+ * `replacements` = `{["old_name"] = "convert_to", ...}`
+ * `force_placement` is a boolean indicating whether nodes other than `air` and
+ `ignore` are replaced by the schematic
+ * Returns nil if the schematic could not be loaded.
+
+* `minetest.place_schematic_on_vmanip(vmanip, pos, schematic, rotation, replacement, force_placement)`:
+ * This function is analagous to minetest.place_schematic, but places a schematic onto the
+ specified VoxelManip object `vmanip` instead of the whole map.
+ * Returns false if any part of the schematic was cut-off due to the VoxelManip not
+ containing the full area required, and true if the whole schematic was able to fit.
+ * Returns nil if the schematic could not be loaded.
+ * After execution, any external copies of the VoxelManip contents are invalidated.
+
+* `minetest.serialize_schematic(schematic, format, options)`
+ * Return the serialized schematic specified by schematic (see: Schematic specifier)
+ * in the `format` of either "mts" or "lua".
+ * "mts" - a string containing the binary MTS data used in the MTS file format
+ * "lua" - a string containing Lua code representing the schematic in table format
+ * `options` is a table containing the following optional parameters:
+ * If `lua_use_comments` is true and `format` is "lua", the Lua code generated will have (X, Z)
+ * position comments for every X row generated in the schematic data for easier reading.
+ * If `lua_num_indent_spaces` is a nonzero number and `format` is "lua", the Lua code generated
+ * will use that number of spaces as indentation instead of a tab character.
+
+### Misc.
+* `minetest.get_connected_players()`: returns list of `ObjectRefs`
+* `minetest.hash_node_position({x=,y=,z=})`: returns an 48-bit integer
+ * Gives a unique hash number for a node position (16+16+16=48bit)
+* `minetest.get_position_from_hash(hash)`: returns a position
+ * Inverse transform of `minetest.hash_node_position`
+* `minetest.get_item_group(name, group)`: returns a rating
+ * Get rating of a group of an item. (`0` means: not in group)
+* `minetest.get_node_group(name, group)`: returns a rating
+ * Deprecated: An alias for the former.
+* `minetest.raillike_group(name)`: returns a rating
+ * Returns rating of the connect_to_raillike group corresponding to name
+ * If name is not yet the name of a connect_to_raillike group, a new group id
+ * is created, with that name
+* `minetest.get_content_id(name)`: returns an integer
+ * Gets the internal content ID of `name`
+* `minetest.get_name_from_content_id(content_id)`: returns a string
+ * Gets the name of the content with that content ID
+* `minetest.parse_json(string[, nullvalue])`: returns something
+ * Convert a string containing JSON data into the Lua equivalent
+ * `nullvalue`: returned in place of the JSON null; defaults to `nil`
+ * On success returns a table, a string, a number, a boolean or `nullvalue`
+ * On failure outputs an error message and returns `nil`
+ * Example: `parse_json("[10, {\"a\":false}]")`, returns `{10, {a = false}}`
+* `minetest.write_json(data[, styled])`: returns a string or `nil` and an error message
+ * Convert a Lua table into a JSON string
+ * styled: Outputs in a human-readable format if this is set, defaults to false
+ * Unserializable things like functions and userdata are saved as null.
+ * **Warning**: JSON is more strict than the Lua table format.
+ 1. You can only use strings and positive integers of at least one as keys.
+ 2. You can not mix string and integer keys.
+ This is due to the fact that JSON has two distinct array and object values.
+ * Example: `write_json({10, {a = false}})`, returns `"[10, {\"a\": false}]"`
+* `minetest.serialize(table)`: returns a string
+ * Convert a table containing tables, strings, numbers, booleans and `nil`s
+ into string form readable by `minetest.deserialize`
+ * Example: `serialize({foo='bar'})`, returns `'return { ["foo"] = "bar" }'`
+* `minetest.deserialize(string)`: returns a table
+ * Convert a string returned by `minetest.deserialize` into a table
+ * `string` is loaded in an empty sandbox environment.
+ * Will load functions, but they cannot access the global environment.
+ * Example: `deserialize('return { ["foo"] = "bar" }')`, returns `{foo='bar'}`
+ * Example: `deserialize('print("foo")')`, returns `nil` (function call fails)
+ * `error:[string "print("foo")"]:1: attempt to call global 'print' (a nil value)`
+* `minetest.compress(data, method, ...)`: returns `compressed_data`
+ * Compress a string of data.
+ * `method` is a string identifying the compression method to be used.
+ * Supported compression methods:
+ * Deflate (zlib): `"deflate"`
+ * `...` indicates method-specific arguments. Currently defined arguments are:
+ * Deflate: `level` - Compression level, `0`-`9` or `nil`.
+* `minetest.decompress(compressed_data, method, ...)`: returns data
+ * Decompress a string of data (using ZLib).
+ * See documentation on `minetest.compress()` for supported compression methods.
+ * currently supported.
+ * `...` indicates method-specific arguments. Currently, no methods use this.
+* `minetest.is_protected(pos, name)`: returns boolean
+ * Returns true, if player `name` shouldn't be abled to dig at `pos` or do other
+ actions, defineable by mods, due to some mod-defined ownership-like concept.
+ Returns false or nil, if the player is allowed to do such actions.
+ * This function should be overridden by protection mods and should be used to
+ check if a player can interact at a position.
+ * This function should call the old version of itself if the position is not
+ protected by the mod.
+ * Example:
+
+ local old_is_protected = minetest.is_protected
+ function minetest.is_protected(pos, name)
+ if mymod:position_protected_from(pos, name) then
+ return true
+ end
+ return old_is_protected(pos, name)
+ end
+* `minetest.record_protection_violation(pos, name)`
+ * This function calls functions registered with
+ `minetest.register_on_protection_violation`.
+* `minetest.rotate_and_place(itemstack, placer, pointed_thing, infinitestacks, orient_flags)`
+ * Attempt to predict the desired orientation of the facedir-capable node
+ defined by `itemstack`, and place it accordingly (on-wall, on the floor, or
+ hanging from the ceiling). Stacks are handled normally if the `infinitestacks`
+ field is false or omitted (else, the itemstack is not changed). `orient_flags`
+ is an optional table containing extra tweaks to the placement code:
+ * `invert_wall`: if `true`, place wall-orientation on the ground and ground-
+ orientation on the wall.
+ * `force_wall` : if `true`, always place the node in wall orientation.
+ * `force_ceiling`: if `true`, always place on the ceiling.
+ * `force_floor`: if `true`, always place the node on the floor.
+ * `force_facedir`: if `true`, forcefully reset the facedir to north when placing on
+ the floor or ceiling
+ * The first four options are mutually-exclusive; the last in the list takes
+ precedence over the first.
+* `minetest.rotate_node(itemstack, placer, pointed_thing)`
+ * calls `rotate_and_place()` with infinitestacks set according to the state of
+ the creative mode setting, and checks for "sneak" to set the `invert_wall`
+ parameter.
+
+* `minetest.forceload_block(pos)`
+ * forceloads the position `pos`.
+ * returns `true` if area could be forceloaded
+ * Please note that forceloaded areas are saved when the server restarts.
+
+* `minetest.forceload_free_block(pos)`
+ * stops forceloading the position `pos`
+
+* `minetest.request_insecure_environment()`: returns an environment containing
+ insecure functions if the calling mod has been listed as trusted in the
+ `secure.trusted_mods` setting or security is disabled, otherwise returns `nil`.
+ * Only works at init time.
+ * **DO NOT ALLOW ANY OTHER MODS TO ACCESS THE RETURNED ENVIRONMENT, STORE IT IN
+ A LOCAL VARIABLE!**
+
+* `minetest.global_exists(name)`
+ * Checks if a global variable has been set, without triggering a warning.
+
+### Global objects
+* `minetest.env`: `EnvRef` of the server environment and world.
+ * Any function in the minetest namespace can be called using the syntax
+ `minetest.env:somefunction(somearguments)`
+ instead of `minetest.somefunction(somearguments)`
+ * Deprecated, but support is not to be dropped soon
+
+### Global tables
+* `minetest.registered_items`
+ * Map of registered items, indexed by name
+* `minetest.registered_nodes`
+ * Map of registered node definitions, indexed by name
+* `minetest.registered_craftitems`
+ * Map of registered craft item definitions, indexed by name
+* `minetest.registered_tools`
+ * Map of registered tool definitions, indexed by name
+* `minetest.registered_entities`
+ * Map of registered entity prototypes, indexed by name
+* `minetest.object_refs`
+ * Map of object references, indexed by active object id
+* `minetest.luaentities`
+ * Map of Lua entities, indexed by active object id
+* `minetest.registered_ores`
+ * List of registered ore definitions.
+* `minetest.registered_decorations`
+ * List of registered decoration definitions.