minetest.register decoration

Description
The decoration definition is a table containing the following fields:


 * Node that decoration can be placed on


 * Size of divisions made in the chunk being generated.
 * If the chunk size is not evenly divisible by sidelen, sidelen is made equal to the chunk size.


 * Ratio of the division to be uniformly filled by the decoration.
 * Used only if noise_params is not specified.


 * NoiseParams structure describing the 2D perlin noise used for decoration distribution.
 * The value of the perlin noise at the center of the division is the fill_ratio used for this division.


 * List of biomes in which this decoration occurs. Occurs in all biomes if this is omitted,
 * and ignored if the Mapgen being used does not support biomes.

Simple-type parameters

 * The node name used as the decoration.
 * If instead a list of strings, a randomly selected node from the list is placed as the decoration.


 * Number of nodes high the decoration is made.
 * If height_max is not 0, this is the lower bound of the randomly selected height.


 * Number of nodes the decoration can be at maximum.
 * If absent, the parameter 'height' is used as a constant.


 * Node that the decoration only spawns next to, in a 1-node square radius.


 * Number of spawn_by nodes that must be surrounding the decoration position to occur.
 * If absent or -1, decorations occur next to any nodes.

Schematic-type parameters

 * If schematic is a string, it is the filepath relative to the current working directory of the
 * specified Minetest schematic file.
 * - OR -, could instead be a table containing two mandatory fields, size and data,
 * and an optional table yslice_prob:
 * See 'Schematic specifier' for details.


 * Flags for schematic decorations. See 'Schematic attributes'.


 * Rotation can be "0", "90", "180", "270", or "random".

Simple decoration
This code would spawn a single block (an example bush in this case) on top of an example grass block in a grassland biome, assuming this biome has been specified before:

Schematic decoration
This is a slightly modified code snippet from an early version of the game “Weird”. It first generates a simple cuboid as schematic in-line and then uses minetest.register_decoration to scatter the cuboids around a biome.