-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(separator)
-^ 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}) -> "(X,Y,Z)"
-^ Convert position to a printable string
-minetest.string_to_pos(string) -> position
-^ Same but in reverse. Returns nil if the string can't be parsed to a position.
-minetest.formspec_escape(string) -> string
-^ escapes characters [ ] \ , ; that 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) -> table
-^ returns a deep copy of a table
-
-minetest namespace reference
------------------------------
-Utilities:
-minetest.get_current_modname() -> string
-minetest.get_modpath(modname) -> e.g. "/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() -> 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) -> bool, missing_features
-^ arg: string or table in format {foo=true, bar=true}
-^ missing_features: {foo=true, bar=true}
-minetest.get_player_information(playername)
-^ table containing information about player peer:
-{
- 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
-}
-
-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)
-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})
-
-Global callback registration functions: (Call these 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_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="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
-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 (ie: 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)
-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)
-
-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) -> 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
- 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.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: e.g. {"ignore", "group:tree"} or "default:dirt"
-minetest.find_nodes_in_area(minp, maxp, nodenames) -> list of positions
-^ 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()
-^ Return voxel manipulator object
-minetest.get_voxel_manip(p1, p2)
-^ Return voxel manipulator object with blank data preallocated
-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
-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, 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 of true) that specifies whether the setting
-^ should be applied to the default config or current active config
-minetest.clear_objects()
-^ clear all objects in the environments
-minetest.line_of_sight(pos1, pos2, stepsize) -> true/false, 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)
-^ -> 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
-
-Inventory:
-minetest.get_inventory(location) -> InvRef
-^ location = e.g. {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.
-
-Formspec:
-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
-minetest.formspec_escape(string) -> string
-^ escapes characters [ ] \ , ; that can not be used in formspecs
-minetest.explode_table_event(string) -> table
-^ returns e.g. {type="CHG", row=1, column=2}
-^ type: "INV" (no row selected), "CHG" (selected) or "DCL" (double-click)
-minetest.explode_textlist_event(string) -> table
-^ returns e.g. {type="CHG", index=1}
-^ type: "INV" (no row selected), "CHG" (selected) or "DCL" (double-click)
-minetest.explode_scrollbar_event(string) -> table
-^ returns e.g. {type="CHG", value=500}
-^ type: "INV" (something failed), "CHG" (has been changed) or "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) -> 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 (e.g. dropping items on
- ground)
-
-Rollback:
-minetest.rollback_get_node_actions(pos, range, seconds, limit) -> {{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) -> 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, 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 can be nil.
-
-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) -> 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
-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
-^ 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 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,
- ^ 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 entry 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.
- ^ 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 is 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 be "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
-
-Misc.:
-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_position_from_hash(hash) -> position
-^ Inverse transform of minetest.hash_node_position
-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}]") -> {10, {a = false}}
-minetest.write_json(data[, styled]) -> string or nil and 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}}) -> "[10, {\"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)
-minetest.compress(data, method, ...) -> 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, ...) -> 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) -> bool
-^ 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.
-
- The above four options are mutually-exclusive; the last in the list takes
- precedence over the first.
-
- force_facedir: if true, forcefully reset the facedir to north when placing on
- the floor or ceiling
-
-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
-
-minetest.forceload_free_block(pos)
-^ stops forceloading the position pos.
+* `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.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 a string
+* `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(playername)`
+ * table containing information about player peer.
+
+Example of `minetest.get_player_information` 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
+ }
+
+### Logging
+* `minetest.debug(line)`
+ * Always printed to `stderr` and logfile (`print()` is redirected here)
+* `minetest.log(line)`
+* `minetest.log(loglevel, line)`
+ * `loglevel` is one of `"error"`, `"action"`, `"info"`, `"verbose"`
+
+### 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_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
+* `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)`
+* `minetest.setting_get(name)`: returns string or `nil`
+* `minetest.setting_setbool(name, value)`
+* `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
+* `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(name, {priv1=true,...})`: returns `bool, missing_privs`
+ * A quickhand for checking privileges
+* `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)` returns a number between `0` and `15` or `nil`
+ * `timeofday`: `nil` for current time, `0` for night, `0.5` for 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
+ * 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.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` 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`
+ * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
+* `minetest.find_nodes_in_area(minp, maxp, nodenames)`: returns a list of positions
+ * `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
+* `minetest.get_mapgen_object(objectname)`
+ * Return requested mapgen object if available (see "Mapgen objects")
+* `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.generate_ores(vm)`
+ * Generate all registered ores within the VoxelManip specified by `vm`.
+* `minetest.generate_decorations(vm)`
+ * Generate all registered decorations within the VoxelManip specified by `vm`.
+* `minetest.clear_objects()`
+ * clear all objects in the environments
+* `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
+ * `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.
+
+### 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`
+ * `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` can be `nil`.
+
+### 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()`: request for server shutdown
+* `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`
+ * `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
+
+### 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.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
+ * 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
+
+* `minetest.forceload_free_block(pos)`
+ * stops forceloading the position `pos`