+**WARNING**: Use this ore type *very* sparingly since it is ~200x more
+computationally expensive than any other ore.
+
+### `stratum`
+
+Creates a single undulating ore stratum that is continuous across mapchunk
+borders and horizontally spans the world.
+
+The 2D perlin noise described by `noise_params` defines the Y co-ordinate of
+the stratum midpoint. The 2D perlin noise described by `np_stratum_thickness`
+defines the stratum's vertical thickness (in units of nodes). Due to being
+continuous across mapchunk borders the stratum's vertical thickness is
+unlimited.
+
+If the noise parameter `noise_params` is omitted the ore will occur from y_min
+to y_max in a simple horizontal stratum.
+
+A parameter `stratum_thickness` can be provided instead of the noise parameter
+`np_stratum_thickness`, to create a constant thickness.
+
+Leaving out one or both noise parameters makes the ore generation less
+intensive, useful when adding multiple strata.
+
+`y_min` and `y_max` define the limits of the ore generation and for performance
+reasons should be set as close together as possible but without clipping the
+stratum's Y variation.
+
+Each node in the stratum has a 1-in-`clust_scarcity` chance of being ore, so a
+solid-ore stratum would require a `clust_scarcity` of 1.
+
+The parameters `clust_num_ores`, `clust_size`, `noise_threshold` and
+`random_factor` are ignored by this ore type.
+
+Ore attributes
+--------------
+
+See section [Flag Specifier Format].
+
+Currently supported flags:
+`puff_cliffs`, `puff_additive_composition`.
+
+### `puff_cliffs`
+
+If set, puff ore generation will not taper down large differences in
+displacement when approaching the edge of a puff. This flag has no effect for
+ore types other than `puff`.
+
+### `puff_additive_composition`
+
+By default, when noise described by `np_puff_top` or `np_puff_bottom` results
+in a negative displacement, the sub-column at that point is not generated. With
+this attribute set, puff ore generation will instead generate the absolute
+difference in noise displacement values. This flag has no effect for ore types
+other than `puff`.
+
+
+
+
+Decoration types
+================
+
+The varying types of decorations that can be placed.
+
+`simple`
+--------
+
+Creates a 1 times `H` times 1 column of a specified node (or a random node from
+a list, if a decoration list is specified). Can specify a certain node it must
+spawn next to, such as water or lava, for example. Can also generate a
+decoration of random height between a specified lower and upper bound.
+This type of decoration is intended for placement of grass, flowers, cacti,
+papyri, waterlilies and so on.
+
+`schematic`
+-----------
+
+Copies a box of `MapNodes` from a specified schematic file (or raw description).
+Can specify a probability of a node randomly appearing when placed.
+This decoration type is intended to be used for multi-node sized discrete
+structures, such as trees, cave spikes, rocks, and so on.
+
+
+
+
+Schematics
+==========
+
+Schematic specifier
+--------------------
+
+A schematic specifier identifies a schematic by either a filename to a
+Minetest Schematic file (`.mts`) or through raw data supplied through Lua,
+in the form of a table. This table specifies the following fields:
+
+* The `size` field is a 3D vector containing the dimensions of the provided
+ schematic. (required field)
+* The `yslice_prob` field is a table of {ypos, prob} slice tables. A slice table
+ sets the probability of a particular horizontal slice of the schematic being
+ placed. (optional field)
+ `ypos` = 0 for the lowest horizontal slice of a schematic.
+ The default of `prob` is 255.
+* The `data` field is a flat table of MapNode tables making up the schematic,
+ in the order of `[z [y [x]]]`. (required field)
+ Each MapNode table contains:
+ * `name`: the name of the map node to place (required)
+ * `prob` (alias `param1`): the probability of this node being placed
+ (default: 255)
+ * `param2`: the raw param2 value of the node being placed onto the map
+ (default: 0)
+ * `force_place`: boolean representing if the node should forcibly overwrite
+ any previous contents (default: false)
+
+About probability values:
+
+* A probability value of `0` or `1` means that node will never appear
+ (0% chance).
+* A probability value of `254` or `255` means the node will always appear
+ (100% chance).
+* If the probability value `p` is greater than `1`, then there is a
+ `(p / 256 * 100)` percent chance that node will appear when the schematic is
+ placed on the map.
+
+Schematic attributes
+--------------------
+
+See section [Flag Specifier Format].
+
+Currently supported flags: `place_center_x`, `place_center_y`, `place_center_z`,
+ `force_placement`.
+
+* `place_center_x`: Placement of this decoration is centered along the X axis.
+* `place_center_y`: Placement of this decoration is centered along the Y axis.
+* `place_center_z`: Placement of this decoration is centered along the Z axis.
+* `force_placement`: Schematic nodes other than "ignore" will replace existing
+ nodes.
+
+
+
+
+Lua Voxel Manipulator
+=====================
+
+About VoxelManip
+----------------
+
+VoxelManip is a scripting interface to the internal 'Map Voxel Manipulator'
+facility. The purpose of this object is for fast, low-level, bulk access to
+reading and writing Map content. As such, setting map nodes through VoxelManip
+will lack many of the higher level features and concepts you may be used to
+with other methods of setting nodes. For example, nodes will not have their
+construction and destruction callbacks run, and no rollback information is
+logged.
+
+It is important to note that VoxelManip is designed for speed, and *not* ease
+of use or flexibility. If your mod requires a map manipulation facility that
+will handle 100% of all edge cases, or the use of high level node placement
+features, perhaps `minetest.set_node()` is better suited for the job.
+
+In addition, VoxelManip might not be faster, or could even be slower, for your
+specific use case. VoxelManip is most effective when setting large areas of map
+at once - for example, if only setting a 3x3x3 node area, a
+`minetest.set_node()` loop may be more optimal. Always profile code using both
+methods of map manipulation to determine which is most appropriate for your
+usage.
+
+A recent simple test of setting cubic areas showed that `minetest.set_node()`
+is faster than a VoxelManip for a 3x3x3 node cube or smaller.
+
+Using VoxelManip
+----------------
+
+A VoxelManip object can be created any time using either:
+`VoxelManip([p1, p2])`, or `minetest.get_voxel_manip([p1, p2])`.
+
+If the optional position parameters are present for either of these routines,
+the specified region will be pre-loaded into the VoxelManip object on creation.
+Otherwise, the area of map you wish to manipulate must first be loaded into the
+VoxelManip object using `VoxelManip:read_from_map()`.
+
+Note that `VoxelManip:read_from_map()` returns two position vectors. The region
+formed by these positions indicate the minimum and maximum (respectively)
+positions of the area actually loaded in the VoxelManip, which may be larger
+than the area requested. For convenience, the loaded area coordinates can also
+be queried any time after loading map data with `VoxelManip:get_emerged_area()`.
+
+Now that the VoxelManip object is populated with map data, your mod can fetch a
+copy of this data using either of two methods. `VoxelManip:get_node_at()`,
+which retrieves an individual node in a MapNode formatted table at the position
+requested is the simplest method to use, but also the slowest.
+
+Nodes in a VoxelManip object may also be read in bulk to a flat array table
+using:
+
+* `VoxelManip:get_data()` for node content (in Content ID form, see section
+ [Content IDs]),
+* `VoxelManip:get_light_data()` for node light levels, and
+* `VoxelManip:get_param2_data()` for the node type-dependent "param2" values.
+
+See section [Flat array format] for more details.
+
+It is very important to understand that the tables returned by any of the above
+three functions represent a snapshot of the VoxelManip's internal state at the
+time of the call. This copy of the data will not magically update itself if
+another function modifies the internal VoxelManip state.
+Any functions that modify a VoxelManip's contents work on the VoxelManip's
+internal state unless otherwise explicitly stated.
+
+Once the bulk data has been edited to your liking, the internal VoxelManip
+state can be set using:
+
+* `VoxelManip:set_data()` for node content (in Content ID form, see section
+ [Content IDs]),
+* `VoxelManip:set_light_data()` for node light levels, and
+* `VoxelManip:set_param2_data()` for the node type-dependent `param2` values.
+
+The parameter to each of the above three functions can use any table at all in
+the same flat array format as produced by `get_data()` etc. and is not required
+to be a table retrieved from `get_data()`.
+
+Once the internal VoxelManip state has been modified to your liking, the
+changes can be committed back to the map by calling `VoxelManip:write_to_map()`
+
+### Flat array format
+
+Let
+ `Nx = p2.X - p1.X + 1`,
+ `Ny = p2.Y - p1.Y + 1`, and
+ `Nz = p2.Z - p1.Z + 1`.
+
+Then, for a loaded region of p1..p2, this array ranges from `1` up to and
+including the value of the expression `Nx * Ny * Nz`.
+
+Positions offset from p1 are present in the array with the format of:
+
+ [
+ (0, 0, 0), (1, 0, 0), (2, 0, 0), ... (Nx, 0, 0),
+ (0, 1, 0), (1, 1, 0), (2, 1, 0), ... (Nx, 1, 0),
+ ...
+ (0, Ny, 0), (1, Ny, 0), (2, Ny, 0), ... (Nx, Ny, 0),
+ (0, 0, 1), (1, 0, 1), (2, 0, 1), ... (Nx, 0, 1),
+ ...
+ (0, Ny, 2), (1, Ny, 2), (2, Ny, 2), ... (Nx, Ny, 2),
+ ...
+ (0, Ny, Nz), (1, Ny, Nz), (2, Ny, Nz), ... (Nx, Ny, Nz)
+ ]
+
+and the array index for a position p contained completely in p1..p2 is:
+
+`(p.Z - p1.Z) * Ny * Nx + (p.Y - p1.Y) * Nx + (p.X - p1.X) + 1`
+
+Note that this is the same "flat 3D array" format as
+`PerlinNoiseMap:get3dMap_flat()`.
+VoxelArea objects (see section [`VoxelArea`]) can be used to simplify calculation
+of the index for a single point in a flat VoxelManip array.
+
+### Content IDs
+
+A Content ID is a unique integer identifier for a specific node type.
+These IDs are used by VoxelManip in place of the node name string for
+`VoxelManip:get_data()` and `VoxelManip:set_data()`. You can use
+`minetest.get_content_id()` to look up the Content ID for the specified node
+name, and `minetest.get_name_from_content_id()` to look up the node name string
+for a given Content ID.
+After registration of a node, its Content ID will remain the same throughout
+execution of the mod.
+Note that the node being queried needs to have already been been registered.
+
+The following builtin node types have their Content IDs defined as constants:
+
+* `minetest.CONTENT_UNKNOWN`: ID for "unknown" nodes
+* `minetest.CONTENT_AIR`: ID for "air" nodes
+* `minetest.CONTENT_IGNORE`: ID for "ignore" nodes
+
+### Mapgen VoxelManip objects
+
+Inside of `on_generated()` callbacks, it is possible to retrieve the same
+VoxelManip object used by the core's Map Generator (commonly abbreviated
+Mapgen). Most of the rules previously described still apply but with a few
+differences:
+
+* The Mapgen VoxelManip object is retrieved using:
+ `minetest.get_mapgen_object("voxelmanip")`
+* This VoxelManip object already has the region of map just generated loaded
+ into it; it's not necessary to call `VoxelManip:read_from_map()` before using
+ a Mapgen VoxelManip.
+* The `on_generated()` callbacks of some mods may place individual nodes in the
+ generated area using non-VoxelManip map modification methods. Because the
+ same Mapgen VoxelManip object is passed through each `on_generated()`
+ callback, it becomes necessary for the Mapgen VoxelManip object to maintain
+ consistency with the current map state. For this reason, calling any of the
+ following functions:
+ `minetest.add_node()`, `minetest.set_node()`, or `minetest.swap_node()`
+ will also update the Mapgen VoxelManip object's internal state active on the
+ current thread.
+* After modifying the Mapgen VoxelManip object's internal buffer, it may be
+ necessary to update lighting information using either:
+ `VoxelManip:calc_lighting()` or `VoxelManip:set_lighting()`.
+
+### Other API functions operating on a VoxelManip
+
+If any VoxelManip contents were set to a liquid node,
+`VoxelManip:update_liquids()` must be called for these liquid nodes to begin
+flowing. It is recommended to call this function only after having written all
+buffered data back to the VoxelManip object, save for special situations where
+the modder desires to only have certain liquid nodes begin flowing.
+
+The functions `minetest.generate_ores()` and `minetest.generate_decorations()`
+will generate all registered decorations and ores throughout the full area
+inside of the specified VoxelManip object.
+
+`minetest.place_schematic_on_vmanip()` is otherwise identical to
+`minetest.place_schematic()`, except instead of placing the specified schematic
+directly on the map at the specified position, it will place the schematic
+inside the VoxelManip.
+
+### Notes
+
+* Attempting to read data from a VoxelManip object before map is read will
+ result in a zero-length array table for `VoxelManip:get_data()`, and an
+ "ignore" node at any position for `VoxelManip:get_node_at()`.
+* If either a region of map has not yet been generated or is out-of-bounds of
+ the map, that region is filled with "ignore" nodes.
+* Other mods, or the core itself, could possibly modify the area of map
+ currently loaded into a VoxelManip object. With the exception of Mapgen
+ VoxelManips (see above section), the internal buffers are not updated. For
+ this reason, it is strongly encouraged to complete the usage of a particular
+ VoxelManip object in the same callback it had been created.
+* If a VoxelManip object will be used often, such as in an `on_generated()`
+ callback, consider passing a file-scoped table as the optional parameter to
+ `VoxelManip:get_data()`, which serves as a static buffer the function can use
+ to write map data to instead of returning a new table each call. This greatly
+ enhances performance by avoiding unnecessary memory allocations.
+
+Methods
+-------
+
+* `read_from_map(p1, p2)`: Loads a chunk of map into the VoxelManip object
+ containing the region formed by `p1` and `p2`.
+ * returns actual emerged `pmin`, actual emerged `pmax`
+* `write_to_map([light])`: Writes the data loaded from the `VoxelManip` back to
+ the map.
+ * **important**: data must be set using `VoxelManip:set_data()` before
+ calling this.
+ * if `light` is true, then lighting is automatically recalculated.
+ The default value is true.
+ If `light` is false, no light calculations happen, and you should correct
+ all modified blocks with `minetest.fix_light()` as soon as possible.
+ Keep in mind that modifying the map where light is incorrect can cause
+ more lighting bugs.
+* `get_node_at(pos)`: Returns a `MapNode` table of the node currently loaded in
+ the `VoxelManip` at that position
+* `set_node_at(pos, node)`: Sets a specific `MapNode` in the `VoxelManip` at
+ that position.
+* `get_data([buffer])`: Retrieves the node content data loaded into the
+ `VoxelManip` object.
+ * returns raw node data in the form of an array of node content IDs
+ * if the param `buffer` is present, this table will be used to store the
+ result instead.
+* `set_data(data)`: Sets the data contents of the `VoxelManip` object
+* `update_map()`: Does nothing, kept for compatibility.
+* `set_lighting(light, [p1, p2])`: Set the lighting within the `VoxelManip` to
+ a uniform value.
+ * `light` is a table, `{day=<0...15>, night=<0...15>}`
+ * To be used only by a `VoxelManip` object from
+ `minetest.get_mapgen_object`.
+ * (`p1`, `p2`) is the area in which lighting is set, defaults to the whole
+ area if left out.
+* `get_light_data()`: Gets the light data read into the `VoxelManip` object
+ * Returns an array (indices 1 to volume) of integers ranging from `0` to
+ `255`.
+ * Each value is the bitwise combination of day and night light values
+ (`0` to `15` each).
+ * `light = day + (night * 16)`
+* `set_light_data(light_data)`: Sets the `param1` (light) contents of each node
+ in the `VoxelManip`.
+ * expects lighting data in the same format that `get_light_data()` returns
+* `get_param2_data([buffer])`: Gets the raw `param2` data read into the
+ `VoxelManip` object.
+ * Returns an array (indices 1 to volume) of integers ranging from `0` to
+ `255`.
+ * If the param `buffer` is present, this table will be used to store the
+ result instead.
+* `set_param2_data(param2_data)`: Sets the `param2` contents of each node in
+ the `VoxelManip`.
+* `calc_lighting([p1, p2], [propagate_shadow])`: Calculate lighting within the
+ `VoxelManip`.
+ * To be used only by a `VoxelManip` object from
+ `minetest.get_mapgen_object`.
+ * (`p1`, `p2`) is the area in which lighting is set, defaults to the whole
+ area if left out or nil. For almost all uses these should be left out
+ or nil to use the default.
+ * `propagate_shadow` is an optional boolean deciding whether shadows in a
+ generated mapchunk above are propagated down into the mapchunk, defaults
+ to `true` if left out.
+* `update_liquids()`: Update liquid flow
+* `was_modified()`: Returns `true` or `false` if the data in the voxel
+ manipulator had been modified since the last read from map, due to a call to
+ `minetest.set_data()` on the loaded area elsewhere.
+* `get_emerged_area()`: Returns actual emerged minimum and maximum positions.
+
+`VoxelArea`
+-----------
+
+A helper class for voxel areas.
+It can be created via `VoxelArea:new{MinEdge=pmin, MaxEdge=pmax}`.
+The coordinates are *inclusive*, like most other things in Minetest.
+
+### Methods
+
+* `getExtent()`: returns a 3D vector containing the size of the area formed by
+ `MinEdge` and `MaxEdge`.
+* `getVolume()`: returns the volume of the area formed by `MinEdge` and
+ `MaxEdge`.
+* `index(x, y, z)`: returns the index of an absolute position in a flat array
+ starting at `1`.
+ * `x`, `y` and `z` must be integers to avoid an incorrect index result.
+ * The position (x, y, z) is not checked for being inside the area volume,
+ being outside can cause an incorrect index result.
+ * Useful for things like `VoxelManip`, raw Schematic specifiers,
+ `PerlinNoiseMap:get2d`/`3dMap`, and so on.
+* `indexp(p)`: same functionality as `index(x, y, z)` but takes a vector.
+ * As with `index(x, y, z)`, the components of `p` must be integers, and `p`
+ is not checked for being inside the area volume.
+* `position(i)`: returns the absolute position vector corresponding to index
+ `i`.
+* `contains(x, y, z)`: check if (`x`,`y`,`z`) is inside area formed by
+ `MinEdge` and `MaxEdge`.
+* `containsp(p)`: same as above, except takes a vector
+* `containsi(i)`: same as above, except takes an index `i`
+* `iter(minx, miny, minz, maxx, maxy, maxz)`: returns an iterator that returns
+ indices.
+ * from (`minx`,`miny`,`minz`) to (`maxx`,`maxy`,`maxz`) in the order of
+ `[z [y [x]]]`.
+* `iterp(minp, maxp)`: same as above, except takes a vector
+
+
+
+
+Mapgen objects
+==============
+
+A mapgen object is a construct used in map generation. Mapgen objects can be
+used by an `on_generate` callback to speed up operations by avoiding
+unnecessary recalculations, these can be retrieved using the
+`minetest.get_mapgen_object()` function. If the requested Mapgen object is
+unavailable, or `get_mapgen_object()` was called outside of an `on_generate()`
+callback, `nil` is returned.
+
+The following Mapgen objects are currently available:
+
+### `voxelmanip`
+
+This returns three values; the `VoxelManip` object to be used, minimum and
+maximum emerged position, in that order. All mapgens support this object.
+
+### `heightmap`
+
+Returns an array containing the y coordinates of the ground levels of nodes in
+the most recently generated chunk by the current mapgen.
+
+### `biomemap`
+
+Returns an array containing the biome IDs of nodes in the most recently
+generated chunk by the current mapgen.
+
+### `heatmap`
+
+Returns an array containing the temperature values of nodes in the most
+recently generated chunk by the current mapgen.
+
+### `humiditymap`
+
+Returns an array containing the humidity values of nodes in the most recently
+generated chunk by the current mapgen.
+
+### `gennotify`
+
+Returns a table mapping requested generation notification types to arrays of
+positions at which the corresponding generated structures are located within
+the current chunk. To set the capture of positions of interest to be recorded
+on generate, use `minetest.set_gen_notify()`.
+For decorations, the returned positions are the ground surface 'place_on'
+nodes, not the decorations themselves. A 'simple' type decoration is often 1
+node above the returned position and possibly displaced by 'place_offset_y'.
+
+Possible fields of the table returned are:
+
+* `dungeon`
+* `temple`
+* `cave_begin`
+* `cave_end`
+* `large_cave_begin`
+* `large_cave_end`
+* `decoration`
+
+Decorations have a key in the format of `"decoration#id"`, where `id` is the
+numeric unique decoration ID.
+
+
+
+
+Registered entities
+===================
+
+Functions receive a "luaentity" as `self`:
+
+* It has the member `.name`, which is the registered name `("mod:thing")`
+* It has the member `.object`, which is an `ObjectRef` pointing to the object
+* The original prototype stuff is visible directly via a metatable
+
+Callbacks:
+
+* `on_activate(self, staticdata, dtime_s)`
+ * Called when the object is instantiated.
+ * `dtime_s` is the time passed since the object was unloaded, which can be
+ used for updating the entity state.
+* `on_step(self, dtime)`
+ * Called on every server tick, after movement and collision processing.
+ `dtime` is usually 0.1 seconds, as per the `dedicated_server_step` setting
+ in `minetest.conf`.
+* `on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir, damage)`
+ * Called when somebody punches the object.
+ * Note that you probably want to handle most punches using the automatic
+ armor group system.
+ * `puncher`: an `ObjectRef` (can be `nil`)
+ * `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`: damage that will be done to entity.
+* `on_death(self, killer)`
+ * Called when the object dies.
+ * `killer`: an `ObjectRef` (can be `nil`)
+* `on_rightclick(self, clicker)`
+* `on_attach_child(self, child)`
+ * `child`: an `ObjectRef` of the child that attaches
+* `on_detach_child(self, child)`
+ * `child`: an `ObjectRef` of the child that detaches
+* `on_detach(self, parent)`
+ * `parent`: an `ObjectRef` (can be `nil`) from where it got detached
+ * This happens before the parent object is removed from the world
+* `get_staticdata(self)`
+ * Should return a string that will be passed to `on_activate` when the
+ object is instantiated the next time.
+
+
+
+
+L-system trees
+==============
+
+Tree definition
+---------------
+
+ treedef={
+ axiom, --string initial tree axiom
+ rules_a, --string rules set A
+ rules_b, --string rules set B
+ rules_c, --string rules set C
+ rules_d, --string rules set D
+ trunk, --string trunk node name
+ leaves, --string leaves node name
+ leaves2, --string secondary leaves node name
+ leaves2_chance,--num chance (0-100) to replace leaves with leaves2
+ angle, --num angle in deg
+ iterations, --num max # of iterations, usually 2 -5
+ random_level, --num factor to lower nr of iterations, usually 0 - 3
+ trunk_type, --string single/double/crossed) type of trunk: 1 node,
+ -- 2x2 nodes or 3x3 in cross shape
+ thin_branches, --boolean true -> use thin (1 node) branches
+ fruit, --string fruit node name
+ fruit_chance, --num chance (0-100) to replace leaves with fruit node
+ seed, --num random seed, if no seed is provided, the engine
+ will create one.
+ }
+
+Key for special L-System symbols used in axioms
+-----------------------------------------------
+
+* `G`: move forward one unit with the pen up
+* `F`: move forward one unit with the pen down drawing trunks and branches
+* `f`: move forward one unit with the pen down drawing leaves (100% chance)
+* `T`: move forward one unit with the pen down drawing trunks only
+* `R`: move forward one unit with the pen down placing fruit
+* `A`: replace with rules set A
+* `B`: replace with rules set B
+* `C`: replace with rules set C
+* `D`: replace with rules set D
+* `a`: replace with rules set A, chance 90%
+* `b`: replace with rules set B, chance 80%
+* `c`: replace with rules set C, chance 70%
+* `d`: replace with rules set D, chance 60%
+* `+`: yaw the turtle right by `angle` parameter
+* `-`: yaw the turtle left by `angle` parameter
+* `&`: pitch the turtle down by `angle` parameter
+* `^`: pitch the turtle up by `angle` parameter
+* `/`: roll the turtle to the right by `angle` parameter
+* `*`: roll the turtle to the left by `angle` parameter
+* `[`: save in stack current state info
+* `]`: recover from stack state info
+
+Example
+-------
+
+Spawn a small apple tree:
+
+ pos = {x=230,y=20,z=4}
+ apple_tree={
+ axiom="FFFFFAFFBF",
+ rules_a="[&&&FFFFF&&FFFF][&&&++++FFFFF&&FFFF][&&&----FFFFF&&FFFF]",
+ rules_b="[&&&++FFFFF&&FFFF][&&&--FFFFF&&FFFF][&&&------FFFFF&&FFFF]",
+ trunk="default:tree",
+ leaves="default:leaves",
+ angle=30,
+ iterations=2,
+ random_level=0,
+ trunk_type="single",
+ thin_branches=true,
+ fruit_chance=10,
+ fruit="default:apple"
+ }
+ minetest.spawn_tree(pos,apple_tree)
+
+
+
+
+'minetest' namespace reference
+==============================
+
+Utilities
+---------
+
+* `minetest.get_current_modname()`: returns the currently loading mod's name,
+ when 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
+
+ {
+ glasslike_framed = true, -- 0.4.7
+ nodebox_as_selectionbox = true, -- 0.4.7
+ get_all_craft_recipes_works = true, -- 0.4.7
+ -- The transparency channel of textures can optionally be used on
+ -- nodes (0.4.7)
+ use_texture_alpha = true,
+ -- Tree and grass ABMs are no longer done from C++ (0.4.8)
+ no_legacy_abms = true,
+ -- Texture grouping is possible using parentheses (0.4.11)
+ texture_names_parens = true,
+ -- Unique Area ID for AreaStore:insert_area (0.4.14)
+ area_store_custom_ids = true,
+ -- add_entity supports passing initial staticdata to on_activate
+ -- (0.4.16)
+ add_entity_with_staticdata = true,
+ -- Chat messages are no longer predicted (0.4.16)
+ no_chat_message_prediction = true,
+ -- The transparency channel of textures can optionally be used on
+ -- objects (ie: players and lua entities) (5.0.0)
+ object_use_texture_alpha = true,
+ -- Object selectionbox is settable independently from collisionbox
+ -- (5.0.0)
+ object_independent_selectionbox = true,
+ -- Specifies whether binary data can be uploaded or downloaded using
+ -- the HTTP API (5.1.0)
+ httpfetch_binary_data = 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)`: Table containing information
+ about a 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
+ protocol_version = 32, -- protocol version used by client
+ -- following information is available on debug build only!!!
+ -- DO NOT USE IN MODS
+ --ser_vers = 26, -- serialization 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.
+* `minetest.safe_file_write(path, content)`: returns boolean indicating success
+ * Replaces contents of file at path with new contents in a safe (atomic)
+ way. Use this instead of below code when writing e.g. database files:
+ `local f = io.open(path, "wb"); f:write(content); f:close()`
+* `minetest.get_version()`: returns a table containing components of the
+ engine version. Components:
+ * `project`: Name of the project, eg, "Minetest"
+ * `string`: Simple version, eg, "1.2.3-dev"
+ * `hash`: Full git version (only set if available),
+ eg, "1.2.3-dev-01234567-dirty".
+ Use this for informational purposes only. The information in the returned
+ table does not represent the capabilities of the engine, nor is it
+ reliable or verifiable. Compatible forks will have a different name and
+ version entirely. To check for the presence of engine features, test
+ whether the functions exported by the wanted features exist. For example:
+ `if minetest.check_for_falling then ... end`.
+* `minetest.sha1(data, [raw])`: returns the sha1 hash of data
+ * `data`: string of data to hash
+ * `raw`: return raw bytes instead of hex digits, default: false
+
+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!
+
+### Environment
+
+* `minetest.register_node(name, node definition)`
+* `minetest.register_craftitem(name, item definition)`
+* `minetest.register_tool(name, item 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=minetest.LIGHT_MAX})`
+* `minetest.unregister_item(name)`
+ * Unregisters the item from the engine, and deletes the entry with key
+ `name` from `minetest.registered_items` and from the associated item table
+ according to its nature: `minetest.registered_nodes`, etc.
+* `minetest.register_entity(name, entity definition)`
+* `minetest.register_abm(abm definition)`
+* `minetest.register_lbm(lbm definition)`
+* `minetest.register_alias(alias, original_name)`
+ * Also use this to set the 'mapgen aliases' needed in a game for the core
+ mapgens. See [Mapgen aliases] section above.
+* `minetest.register_alias_force(alias, original_name)`
+* `minetest.register_ore(ore definition)`
+ * Returns an integer uniquely identifying the registered ore on success.
+ * The order of ore registrations determines the order of ore generation.
+* `minetest.register_biome(biome definition)`
+ * Returns an integer uniquely identifying the registered biome on success.
+* `minetest.unregister_biome(name)`
+ * Unregisters the biome from the engine, and deletes the entry with key
+ `name` from `minetest.registered_biomes`.
+* `minetest.register_decoration(decoration definition)`
+ * Returns an integer uniquely identifying the registered decoration on
+ success.
+ * The order of decoration registrations determines the order of decoration
+ generation.
+* `minetest.register_schematic(schematic definition)`
+ * Returns an integer uniquely identifying the registered schematic on
+ success.
+ * If the schematic is loaded from a file, the `name` field is set to the
+ filename.
+ * If the function is called when loading the mod, and `name` is a relative
+ path, then the current mod path will be prepended to the schematic
+ filename.
+* `minetest.clear_registered_ores()`
+ * Clears all ores currently registered.
+* `minetest.clear_registered_biomes()`
+ * Clears all biomes currently registered.
+* `minetest.clear_registered_decorations()`
+ * Clears all decorations currently registered.
+* `minetest.clear_registered_schematics()`
+ * Clears all schematics currently registered.
+
+### Gameplay
+
+* `minetest.register_craft(recipe)`
+ * Check recipe table syntax for different types below.
+* `minetest.clear_craft(recipe)`
+ * Will erase existing craft based either on output item or on input recipe.
+ * Specify either output or input only. If you specify both, input will be
+ ignored. For input use the same recipe table syntax as for
+ `minetest.register_craft(recipe)`. For output specify only the item,
+ without a quantity.
+ * Returns false if no erase candidate could be found, otherwise returns true.
+ * **Warning**! The type field ("shaped", "cooking" or any other) will be
+ ignored if the recipe contains output. Erasing is then done independently
+ from the crafting method.
+* `minetest.register_chatcommand(cmd, chatcommand definition)`
+* `minetest.override_chatcommand(name, redefinition)`
+ * Overrides fields of a chatcommand registered with `register_chatcommand`.
+* `minetest.unregister_chatcommand(name)`
+ * Unregisters a chatcommands registered with `register_chatcommand`.
+* `minetest.register_privilege(name, definition)`
+ * `definition` can be a description or a definition table (see [Privilege
+ definition]).
+ * If it is a description, the priv will be granted to singleplayer and admin
+ by default.
+ * To allow players with `basic_privs` to grant, see the `basic_privs`
+ minetest.conf setting.
+* `minetest.register_authentication_handler(authentication handler definition)`
+ * Registers an auth handler that overrides the builtin one.
+ * This function can be called by a single mod once only.
+
+Global callback registration functions
+--------------------------------------
+
+Call these functions only at load time!
+
+* `minetest.register_globalstep(function(dtime))`
+ * Called every server step, usually interval of 0.1s
+* `minetest.register_on_mods_loaded(function())`
+ * Called after mods have finished loading and before the media is cached or the
+ aliases handled.
+* `minetest.register_on_shutdown(function())`
+ * 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(function(pos, newnode, placer, oldnode, itemstack, pointed_thing))`
+ * Called when a node has been placed
+ * If return `true` no item is taken from `itemstack`
+ * `placer` may be any valid ObjectRef or nil.
+ * **Not recommended**; use `on_construct` or `after_place_node` in node
+ definition whenever possible.
+* `minetest.register_on_dignode(function(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(function(pos, node, puncher, pointed_thing))`
+ * Called when a node is punched
+* `minetest.register_on_generated(function(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(function(ObjectRef))`
+ * Called after a new player has been created
+* `minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage))`
+ * Called when a player is punched
+ * Note: This callback is invoked even if the punched player is dead.
+ * `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(function(player, hp_change, reason), 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.
+ * `reason`: a PlayerHPChangeReason table.
+ * The `type` field will have one of the following values:
+ * `set_hp`: A mod or the engine called `set_hp` without
+ giving a type - use this for custom damage types.
+ * `punch`: Was punched. `reason.object` will hold the puncher, or nil if none.
+ * `fall`
+ * `node_damage`: `damage_per_second` from a neighbouring node.
+ `reason.node` will hold the node name or nil.
+ * `drown`
+ * `respawn`
+ * Any of the above types may have additional fields from mods.
+ * `reason.from` will be `mod` or `engine`.
+ * `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.
+ Non-modifiers receive the final HP change calculated by the modifiers.
+* `minetest.register_on_dieplayer(function(ObjectRef, reason))`
+ * Called when a player dies
+ * `reason`: a PlayerHPChangeReason table, see register_on_player_hpchange
+* `minetest.register_on_respawnplayer(function(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(function(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(function(ObjectRef))`
+ * Called when a player joins the game
+* `minetest.register_on_leaveplayer(function(ObjectRef, timed_out))`
+ * Called when a player leaves the game
+ * `timed_out`: True for timeout, false for other reasons.
+* `minetest.register_on_auth_fail(function(name, ip))`
+ * Called when a client attempts to log into an account but supplies the
+ wrong password.
+ * `ip`: The IP address of the client.
+ * `name`: The account the client attempted to log into.
+* `minetest.register_on_cheat(function(ObjectRef, cheat))`
+ * Called when a player cheats
+ * `cheat`: `{type=<cheat_type>}`, where `<cheat_type>` is one of:
+ * `moved_too_fast`
+ * `interacted_too_far`
+ * `interacted_while_dead`
+ * `finished_unknown_dig`
+ * `dug_unbreakable`
+ * `dug_too_fast`
+* `minetest.register_on_chat_message(function(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(function(player, formname, fields))`
+ * Called when the server received input from `player` in a formspec with
+ the given `formname`. Specifically, this is called on any of the
+ following events:
+ * a button was pressed,
+ * Enter was pressed while the focus was on a text field
+ * a checkbox was toggled,
+ * something was selecteed in a drop-down list,
+ * a different tab was selected,
+ * selection was changed in a textlist or table,
+ * an entry was double-clicked in a textlist or table,
+ * a scrollbar was moved, or
+ * the form was actively closed by the player.
+ * Fields are sent for formspec elements which define a field. `fields`
+ is a table containing each formspecs element value (as string), with
+ the `name` parameter as index for each. The value depends on the
+ formspec element type:
+ * `button` and variants: If pressed, contains the user-facing button
+ text as value. If not pressed, is `nil`
+ * `field`, `textarea` and variants: Text in the field
+ * `dropdown`: Text of selected item
+ * `tabheader`: Tab index, starting with `"1"` (only if tab changed)
+ * `checkbox`: `"true"` if checked, `"false"` if unchecked
+ * `textlist`: See `minetest.explode_textlist_event`
+ * `table`: See `minetest.explode_table_event`
+ * `scrollbar`: See `minetest.explode_scrollbar_event`
+ * Special case: `["quit"]="true"` is sent when the user actively
+ closed the form by mouse click, keypress or through a button_exit[]
+ element.
+ * Special case: `["key_enter"]="true"` is sent when the user pressed
+ the Enter key and the focus was either nowhere (causing the formspec
+ to be closed) or on a button. If the focus was on a text field,
+ additionally, the index `key_enter_field` contains the name of the
+ text field. See also: `field_close_on_enter`.
+ * Newest functions are called first
+ * If function returns `true`, remaining functions are not called
+* `minetest.register_on_craft(function(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(function(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_allow_player_inventory_action(function(player, action, inventory, inventory_info))`
+ * Determinates how much of a stack may be taken, put or moved to a
+ player inventory.
+ * `player` (type `ObjectRef`) is the player who modified the inventory
+ `inventory` (type `InvRef`).
+ * List of possible `action` (string) values and their
+ `inventory_info` (table) contents:
+ * `move`: `{from_list=string, to_list=string, from_index=number, to_index=number, count=number}`
+ * `put`: `{listname=string, index=number, stack=ItemStack}`
+ * `take`: Same as `put`
+ * Return a numeric value to limit the amount of items to be taken, put or
+ moved. A value of `-1` for `take` will make the source stack infinite.
+* `minetest.register_on_player_inventory_action(function(player, action, inventory, inventory_info))`
+ * Called after a take, put or move event from/to/in a player inventory
+ * Function arguments: see `minetest.register_allow_player_inventory_action`
+ * Does not accept or handle any return value.
+* `minetest.register_on_protection_violation(function(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(function(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).
+* `minetest.register_on_priv_grant(function(name, granter, priv))`
+ * Called when `granter` grants the priv `priv` to `name`.
+ * Note that the callback will be called twice if it's done by a player,
+ once with granter being the player name, and again with granter being nil.
+* `minetest.register_on_priv_revoke(function(name, revoker, priv))`
+ * Called when `revoker` revokes the priv `priv` from `name`.
+ * Note that the callback will be called twice if it's done by a player,
+ once with revoker being the player name, and again with revoker being nil.
+* `minetest.register_can_bypass_userlimit(function(name, ip))`
+ * Called when `name` user connects with `ip`.
+ * Return `true` to by pass the player limit
+* `minetest.register_on_modchannel_message(function(channel_name, sender, message))`
+ * Called when an incoming mod channel message is received
+ * You should have joined some channels to receive events.
+ * If message comes from a server mod, `sender` field is an empty string.
+
+Setting-related
+---------------
+
+* `minetest.settings`: Settings object containing all of the settings from the
+ main config file (`minetest.conf`).
+* `minetest.setting_get_pos(name)`: Loads a setting from the main settings and
+ parses it as a position (in the format `(1,2,3)`). Returns a position or nil.
+
+Authentication
+--------------
+
+* `minetest.string_to_privs(str)`: returns `{priv1=true,...}`
+* `minetest.privs_to_string(privs)`: returns `"priv1,priv2,..."`
+ * Convert between two privilege representations
+* `minetest.get_player_privs(name) -> {priv1=true,...}`
+* `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.check_password_entry(name, entry, password)`
+ * Returns true if the "password entry" for a player with name matches given
+ password, false otherwise.
+ * The "password entry" is the password representation generated by the
+ engine as returned as part of a `get_auth()` call on the auth handler.
+ * Only use this function for making it possible to log in via password from
+ external protocols such as IRC, other uses are frowned upon.
+* `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.
+ * For this purpose, use `minetest.check_password_entry` instead.
+* `minetest.get_player_ip(name)`: returns an IP address string for the player
+ `name`.
+ * The player needs to be online for this to be successful.
+
+* `minetest.get_auth_handler()`: Return the currently active auth handler
+ * See the [Authentication handler definition]
+ * Use this to e.g. get the authentication data for a player:
+ `local auth_data = minetest.get_auth_handler().get_auth(playername)`
+* `minetest.notify_authentication_modified(name)`
+ * Must be called by the authentication handler for privilege changes.
+ * `name`: string; if omitted, all auth data should be considered modified
+* `minetest.set_player_password(name, password_hash)`: Set password hash of
+ player `name`.
+* `minetest.set_player_privs(name, {priv1=true,...})`: Set privileges of player
+ `name`.
+* `minetest.auth_reload()`
+ * See `reload()` in authentication handler definition
+
+`minetest.set_player_password`, `minetest_set_player_privs`,
+`minetest_get_player_privs` and `minetest.auth_reload` call the authentication
+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 to `minetest.set_node`
+ * Set node at position `pos`
+ * `node`: table `{name=string, param1=number, param2=number}`
+ * If param1 or param2 is omitted, it's set to `0`.
+ * e.g. `minetest.set_node({x=0, y=10, z=0}, {name="default:wood"})`
+* `minetest.bulk_set_node({pos1, pos2, pos3, ...}, node)`
+ * Set node on all positions set in the first argument.
+ * e.g. `minetest.bulk_set_node({{x=0, y=1, z=1}, {x=1, y=2, z=2}}, {name="default:stone"})`
+ * For node specification or position syntax see `minetest.set_node` call
+ * Faster than set_node due to single call, but still considerably slower
+ than Lua Voxel Manipulators (LVM) for large numbers of nodes.
+ Unlike LVMs, this will call node callbacks. It also allows setting nodes
+ in spread out positions which would cause LVMs to waste memory.
+ For setting a cube, this is 1.3x faster than set_node whereas LVM is 20
+ times faster.
+* `minetest.swap_node(pos, node)`
+ * Set node at position, but don't remove metadata
+* `minetest.remove_node(pos)`
+ * By default it does the same as `minetest.set_node(pos, {name="air"})`
+* `minetest.get_node(pos)`
+ * Returns the node at the given position as table in the format
+ `{name="node_name", param1=0, param2=0}`,
+ returns `{name="ignore", param1=0, param2=0}` for unloaded areas.
+* `minetest.get_node_or_nil(pos)`
+ * Same as `get_node` but returns `nil` for unloaded areas.
+* `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.spawn_falling_node(pos)`
+ * Change node into falling node
+ * Returns `true` if successful, `false` on failure
+
+* `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, [staticdata])`: 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)`: returns a list of
+ ObjectRefs.
+ * `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.get_day_count()`: returns number days elapsed since world was
+ created.
+ * accounts for time changes.
+* `minetest.find_node_near(pos, radius, nodenames, [search_center])`: returns
+ pos or `nil`.
+ * `radius`: using a maximum metric
+ * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
+ * `search_center` is an optional boolean (default: `false`)
+ If true `pos` is also checked for the nodes
+* `minetest.find_nodes_in_area(pos1, pos2, nodenames)`: returns a list of
+ positions.
+ * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
+ * First return value: Table with all node positions
+ * Second return value: Table with the count of each node with the node name
+ as index.
+ * Area volume is limited to 4,096,000 nodes
+* `minetest.find_nodes_in_area_under_air(pos1, pos2, nodenames)`: returns a
+ list of positions.
+ * `nodenames`: e.g. `{"ignore", "group:tree"}` or `"default:dirt"`
+ * Return value: Table with all node positions with a node air above
+ * Area volume is limited to 4,096,000 nodes
+* `minetest.get_perlin(noiseparams)`
+* `minetest.get_perlin(seeddiff, octaves, persistence, spread)`
+ * 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_gen_notify()`
+ * Returns a flagstring and a table with the `deco_id`s.
+* `minetest.get_decoration_id(decoration_name)`
+ * Returns the decoration ID number for the provided decoration name string,
+ or `nil` on failure.
+* `minetest.get_mapgen_object(objectname)`
+ * Return requested mapgen object if available (see [Mapgen objects])
+* `minetest.get_heat(pos)`
+ * Returns the heat at the position, or `nil` on failure.
+* `minetest.get_humidity(pos)`
+ * Returns the humidity at the position, or `nil` on failure.
+* `minetest.get_biome_data(pos)`
+ * Returns a table containing:
+ * `biome` the biome id of the biome at that position
+ * `heat` the heat at the position
+ * `humidity` the humidity at the position
+ * Or returns `nil` on failure.
+* `minetest.get_biome_id(biome_name)`
+ * Returns the biome id, as used in the biomemap Mapgen object and returned
+ by `minetest.get_biome_data(pos)`, for a given biome_name string.
+* `minetest.get_biome_name(biome_id)`
+ * Returns the biome name string for the provided biome id, or `nil` on
+ failure.
+ * If no biomes have been registered, such as in mgv6, returns `default`.
+* `minetest.get_mapgen_params()`
+ * Deprecated: use `minetest.get_mapgen_setting(name)` instead.
+ * Returns a table containing:
+ * `mgname`
+ * `seed`
+ * `chunksize`
+ * `water_level`
+ * `flags`
+* `minetest.set_mapgen_params(MapgenParams)`
+ * Deprecated: use `minetest.set_mapgen_setting(name, value, override)`
+ instead.
+ * 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`
+ * `chunksize`
+ * `water_level`
+ * `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.get_mapgen_setting(name)`
+ * Gets the *active* mapgen setting (or nil if none exists) in string
+ format with the following order of precedence:
+ 1) Settings loaded from map_meta.txt or overrides set during mod
+ execution.
+ 2) Settings set by mods without a metafile override
+ 3) Settings explicitly set in the user config file, minetest.conf
+ 4) Settings set as the user config default
+* `minetest.get_mapgen_setting_noiseparams(name)`
+ * Same as above, but returns the value as a NoiseParams table if the
+ setting `name` exists and is a valid NoiseParams.
+* `minetest.set_mapgen_setting(name, value, [override_meta])`
+ * Sets a mapgen param to `value`, and will take effect if the corresponding
+ mapgen setting is not already present in map_meta.txt.
+ * `override_meta` is an optional boolean (default: `false`). If this is set
+ to true, the setting will become the active setting regardless of the map
+ metafile contents.
+ * Note: to set the seed, use `"seed"`, not `"fixed_map_seed"`.
+* `minetest.set_mapgen_setting_noiseparams(name, value, [override_meta])`
+ * Same as above, except value is a NoiseParams table.
+* `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([options])`
+ * Clear all objects in the environment
+ * Takes an optional table as an argument with the field `mode`.
+ * mode = `"full"` : Load and go through every mapblock, clearing
+ objects (default).
+ * mode = `"quick"`: Clear objects immediately in loaded mapblocks,
+ clear objects in unloaded mapblocks only when the
+ mapblocks are next activated.
+* `minetest.load_area(pos1[, pos2])`
+ * Load the mapblocks containing the area from `pos1` to `pos2`.
+ `pos2` defaults to `pos1` if not specified.
+ * This function does not trigger map generation.
+* `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:
+ * `minetest.EMERGE_CANCELLED`
+ * `minetest.EMERGE_ERRORED`
+ * `minetest.EMERGE_FROM_MEMORY`
+ * `minetest.EMERGE_FROM_DISK`
+ * `minetest.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)`: returns `boolean, pos`
+ * Checks if there is anything other than air between pos1 and pos2.
+ * Returns false if something is blocking the sight.
+ * Returns the position of the blocking node when `false`
+ * `pos1`: First position
+ * `pos2`: Second position
+* `minetest.raycast(pos1, pos2, objects, liquids)`: returns `Raycast`
+ * Creates a `Raycast` object.
+ * `pos1`: start of the ray
+ * `pos2`: end of the ray
+ * `objects`: if false, only nodes will be returned. Default is `true`.
+ * `liquids`: if false, liquid nodes won't be returned. Default is `false`.
+* `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
+* `minetest.fix_light(pos1, pos2)`: returns `true`/`false`
+ * resets the light in a cuboid-shaped part of
+ the map and removes lighting bugs.
+ * Loads the area if it is not loaded.
+ * `pos1` is the corner of the cuboid with the least coordinates
+ (in node coordinates), inclusive.
+ * `pos2` is the opposite corner of the cuboid, inclusive.
+ * The actual updated cuboid might be larger than the specified one,
+ because only whole map blocks can be updated.
+ The actual updated area consists of those map blocks that intersect
+ with the given cuboid.
+ * However, the neighborhood of the updated area might change
+ as well, as light can spread out of the cuboid, also light
+ might be removed.
+ * returns `false` if the area is not fully generated,
+ `true` otherwise
+* `minetest.check_single_for_falling(pos)`
+ * causes an unsupported `group:falling_node` node to fall and causes an
+ unattached `group:attached_node` node to fall.
+ * does not spread these updates to neighbours.
+* `minetest.check_for_falling(pos)`
+ * causes an unsupported `group:falling_node` node to fall and causes an
+ unattached `group:attached_node` node to fall.
+ * spread these updates to neighbours and can cause a cascade
+ of nodes to fall.
+* `minetest.get_spawn_level(x, z)`
+ * Returns a player spawn y co-ordinate for the provided (x, z)
+ co-ordinates, or `nil` for an unsuitable spawn point.
+ * For most mapgens a 'suitable spawn point' is one with y between
+ `water_level` and `water_level + 16`, and in mgv7 well away from rivers,
+ so `nil` will be returned for many (x, z) co-ordinates.
+ * The spawn level returned is for a player spawn in unmodified terrain.
+ * The spawn level is intentionally above terrain level to cope with
+ full-node biome 'dust' nodes.
+
+Mod channels
+------------
+
+You can find mod channels communication scheme in `doc/mod_channels.png`.
+
+* `minetest.mod_channel_join(channel_name)`
+ * Server joins channel `channel_name`, and creates it if necessary. You
+ should listen for incoming messages with
+ `minetest.register_on_modchannel_message`
+
+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, [player_name])`: returns
+ an `InvRef`.
+ * `callbacks`: See [Detached inventory callbacks]
+ * `player_name`: Make detached inventory available to one player
+ exclusively, by default they will be sent to every player (even if not
+ used).
+ Note that this parameter is mostly just a workaround and will be removed
+ in future releases.
+ * Creates a detached inventory. If it already exists, it is cleared.
+* `minetest.remove_detached_inventory(name)`
+ * Returns a `boolean` indicating whether the removal succeeded.
+* `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.close_formspec(playername, formname)`
+ * `playername`: name of player to close formspec
+ * `formname`: has to exactly match the one given in `show_formspec`, or the
+ formspec will not close.
+ * calling `show_formspec(playername, formname, "")` is equal to this
+ expression.
+ * to close a formspec regardless of the formname, call
+ `minetest.close_formspec(playername, "")`.
+ **USE THIS ONLY WHEN ABSOLUTELY NECESSARY!**
+* `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.wallmounted_to_dir(wallmounted)`
+ * Convert a wallmounted value back into a vector aimed directly out the
+ "back" of a node.
+* `minetest.dir_to_yaw(dir)`
+ * Convert a vector into a yaw (angle)
+* `minetest.yaw_to_dir(yaw)`
+ * Convert yaw (angle) to a vector
+* `minetest.is_colored_paramtype(ptype)`
+ * Returns a boolean. Returns `true` if the given `paramtype2` contains
+ color information (`color`, `colorwallmounted` or `colorfacedir`).
+* `minetest.strip_param2_color(param2, paramtype2)`
+ * Removes everything but the color information from the
+ given `param2` value.
+ * Returns `nil` if the given `paramtype2` does not contain color
+ information.
+* `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]={method = "cooking", width = 3, output = "default:gold_ingot",
+ items = {1 = "default:gold_lump"}},
+ [2]={method = "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)
+* `minetest.itemstring_with_palette(item, palette_index)`: returns an item
+ string.
+ * Creates an item string which contains palette index information
+ for hardware colorization. You can use the returned string
+ as an output in a craft recipe.
+ * `item`: the item stack which becomes colored. Can be in string,
+ table and native form.
+ * `palette_index`: this index is added to the item stack
+* `minetest.itemstring_with_color(item, colorstring)`: returns an item string
+ * Creates an item string which contains static color information
+ for hardware colorization. Use this method if you wish to colorize
+ an item that does not own a palette. You can use the returned string
+ as an output in a craft recipe.
+ * `item`: the item stack which becomes colored. Can be in string,
+ table and native form.
+ * `colorstring`: the new color of the item stack
+
+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, prevent_after_place])`
+ * Place item as a node
+ * `param2` overrides `facedir` and wallmounted `param2`
+ * `prevent_after_place`: if set to `true`, `after_place_node` is not called
+ for the newly placed node to prevent a callback and placement loop
+ * 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)`
+* `minetest.sound_fade(handle, step, gain)`
+ * `handle` is a handle returned by `minetest.sound_play`
+ * `step` determines how fast a sound will fade.
+ Negative step will lower the sound volume, positive step will increase
+ the sound volume.
+ * `gain` the target gain for the fade.
+
+Timing
+------
+
+* `minetest.after(time, func, ...)`
+ * Call the function `func` after `time` seconds, may be fractional
+ * Optional: Variable number of arguments that are passed to `func`
+
+Server
+------
+
+* `minetest.request_shutdown([message],[reconnect],[delay])`: request for
+ server shutdown. Will display `message` to clients.
+ * `reconnect` == true displays a reconnect button
+ * `delay` adds an optional delay (in seconds) before shutdown.
+ Negative delay cancels the current active shutdown.
+ Zero delay triggers an immediate shutdown.
+* `minetest.cancel_shutdown_requests()`: cancel current delayed shutdown
+* `minetest.get_server_status(name, joined)`
+ * Returns the server status string when a player joins or when the command
+ `/status` is called. Returns `nil` or an empty string when the message is
+ disabled.
+ * `joined`: Boolean value, indicates whether the function was called when
+ a player joined.
+ * This function may be overwritten by mods to customize the status message.
+* `minetest.get_server_uptime()`: returns the server uptime in seconds
+* `minetest.remove_player(name)`: remove player from database (if they are not
+ connected).
+ * As auth data is not removed, minetest.player_exists will continue to
+ return true. Call the below method as well if you want to remove auth
+ data too.
+ * Returns a code (0: successful, 1: no such player, 2: player is connected)
+* `minetest.remove_player_auth(name)`: remove player authentication data
+ * Returns boolean indicating success (false if player nonexistant)
+
+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 and per-node force-place to the specified
+ nodes according to the `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 an integer value from `0` to `255` that encodes
+ probability and per-node force-place. Probability has levels
+ 0-127, then 128 may be added to encode per-node force-place.
+ For probability stated as 0-255, divide by 2 and round down to
+ get values 0-127, then add 128 to apply per-node force-place.
+ * 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.
+ * Apply the specified probability to the specified horizontal slices
+ according to the `slice_prob_list`.
+ * `slice_prob_list` is an array of tables containing two fields, `ypos`
+ and `prob`.
+ * `ypos` indicates the y position of the slice with a probability
+ applied, the lowest slice being `ypos = 0`.
+ * 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, flags)`
+ * 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.
+ * **Warning**: Once you have loaded a schematic from a file, it will be
+ cached. Future calls will always use the cached version and the
+ replacement list defined for it, regardless of whether the file or the
+ replacement list parameter have changed. The only way to load the file
+ anew is to restart the server.
+ * `flags` is a flag field with the available flags:
+ * place_center_x
+ * place_center_y
+ * place_center_z
+
+* `minetest.place_schematic_on_vmanip(vmanip, pos, schematic, rotation, replacement, force_placement, flags)`:
+ * This function is analogous to minetest.place_schematic, but places a
+ schematic onto the specified VoxelManip object `vmanip` instead of the
+ 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.
+ * `flags` is a flag field with the available flags:
+ * place_center_x
+ * place_center_y
+ * place_center_z
+
+* `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.
+
+HTTP Requests
+-------------
+
+* `minetest.request_http_api()`:
+ * returns `HTTPApiTable` containing http functions if the calling mod has
+ been granted access by being listed in the `secure.http_mods` or
+ `secure.trusted_mods` setting, otherwise returns `nil`.
+ * The returned table contains the functions `fetch`, `fetch_async` and
+ `fetch_async_get` described below.
+ * Only works at init time and must be called from the mod's main scope
+ (not from a function).
+ * Function only exists if minetest server was built with cURL support.
+ * **DO NOT ALLOW ANY OTHER MODS TO ACCESS THE RETURNED TABLE, STORE IT IN
+ A LOCAL VARIABLE!**
+* `HTTPApiTable.fetch(HTTPRequest req, callback)`
+ * Performs given request asynchronously and calls callback upon completion
+ * callback: `function(HTTPRequestResult res)`
+ * Use this HTTP function if you are unsure, the others are for advanced use
+* `HTTPApiTable.fetch_async(HTTPRequest req)`: returns handle
+ * Performs given request asynchronously and returns handle for
+ `HTTPApiTable.fetch_async_get`
+* `HTTPApiTable.fetch_async_get(handle)`: returns HTTPRequestResult
+ * Return response data for given asynchronous HTTP request
+
+Storage API
+-----------
+
+* `minetest.get_mod_storage()`:
+ * returns reference to mod private `StorageRef`
+ * must be called during mod load time
+
+Misc.
+-----
+
+* `minetest.get_connected_players()`: returns list of `ObjectRefs`
+* `minetest.is_player(obj)`: boolean, whether `obj` is a player
+* `minetest.player_exists(name)`: boolean, whether player exists
+ (regardless of online status)
+* `minetest.hud_replace_builtin(name, hud_definition)`
+ * Replaces definition of a builtin hud element
+ * `name`: `"breath"` or `"health"`
+ * `hud_definition`: definition to replace builtin definition
+* `minetest.send_join_message(player_name)`
+ * This function can be overridden by mods to change the join message.
+* `minetest.send_leave_message(player_name, timed_out)`
+ * This function can be overridden by mods to change the leave message.
+* `minetest.hash_node_position(pos)`: returns an 48-bit integer
+ * `pos`: table {x=number, y=number, z=number},
+ * 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 will cause an error.
+ * **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), returns
+ `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.
+ * `...` indicates method-specific arguments. Currently, no methods use this
+* `minetest.rgba(red, green, blue[, alpha])`: returns a string
+ * Each argument is a 8 Bit unsigned integer
+ * Returns the ColorString from rgb or rgba values
+ * Example: `minetest.rgba(10, 20, 30, 40)`, returns `"#0A141E28"`
+* `minetest.encode_base64(string)`: returns string encoded in base64
+ * Encodes a string in base64.
+* `minetest.decode_base64(string)`: returns string
+ * Decodes a string encoded in base64.
+* `minetest.is_protected(pos, name)`: returns boolean
+ * Returns true, if player `name` shouldn't be able to dig at `pos` or do
+ other actions, definable by mods, due to some mod-defined ownership-like
+ concept.
+ * Returns false or nil, if the player is allowed to do such actions.
+ * `name` will be "" for non-players or unknown players.
+ * 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.is_area_protected(pos1, pos2, player_name, interval)`
+ * Returns the position of the first node that `player_name` may not modify
+ in the specified cuboid between `pos1` and `pos2`.
+ * Returns `false` if no protections were found.
+ * Applies `is_protected()` to a 3D lattice of points in the defined volume.
+ The points are spaced evenly throughout the volume and have a spacing
+ similar to, but no larger than, `interval`.
+ * All corners and edges of the defined volume are checked.
+ * `interval` defaults to 4.
+ * `interval` should be carefully chosen and maximised to avoid an excessive
+ number of points being checked.
+ * Like `minetest.is_protected`, this function may be extended or
+ overwritten by mods to provide a faster implementation to check the
+ cuboid for intersections.
+* `minetest.rotate_and_place(itemstack, placer, pointed_thing[, infinitestacks,
+ orient_flags, prevent_after_place])`
+ * 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).
+ * `infinitestacks`: if `true`, the itemstack is not changed. Otherwise the
+ stacks are handled normally.
+ * `orient_flags`: 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.
+ * `prevent_after_place` is directly passed to `minetest.item_place_node`
+ * Returns the new itemstack after placement
+* `minetest.rotate_node(itemstack, placer, pointed_thing)`
+ * calls `rotate_and_place()` with `infinitestacks` set according to the state
+ of the creative mode setting, checks for "sneak" to set the `invert_wall`
+ parameter and `prevent_after_place` set to `true`.