From Minetest Developer Wiki
Jump to: navigation, search

The Biome API is still in an experimental phase and subject to change.


minetest.register_biome({biome definition})


Registers a new biome. The biome properties are specified in the Biome definition (see below).

Biome definition

The biome definition is a regular Lua table:

        name = "tundra",
        node_dust = "default:snow",
        node_top = "default:dirt_with_snow",
        depth_top = 1,
        node_filler = "default:permafrost",
        depth_filler = 3,
        node_stone = "default:bluestone",
        node_water_top = "default:ice",
        depth_water_top = 10,
        node_water = "",
        node_river_water = "default:ice",
        node_riverbed = "default:gravel",
        depth_riverbed = 2,
        y_min = 1,
        y_max = 31000,
        heat_point = 0,
        humidity_point = 50,

Valid fields are:

  • name — Biome name.
  • node_dust — Node dropped onto upper surface after all else is generated.
  • node_top — Node forming surface layer of biome.
  • depth_top — Thickness of the surface layer of biome.
  • node_filler — Node forming lower layer of biome.
  • depth_filler — Thickness of the lower layer of biome.
  • node_stone — Node that replaces all stone nodes between roughly y_min and y_max.
  • node_water_top — Node forming a surface layer in seawater.
  • depth_water_top — Thickness of the surface layer in seawater.
  • node_water — Node that replaces all seawater nodes not in the defined surface layer.
  • node_river_water — Node that replaces river water in mapgens that use default:river_water.
  • node_riverbed — Node placed under river water.
  • depth_riverbed — Thickness of layer under river water.
  • y_min — Lower limit for biome.
  • y_max — Upper limit for biome.

Limits are relative to y = water_level - 1. Because biome is not recalculated for every node in a node column some biome materials can exceed their limits, especially stone. For each node column in a mapchunk, biome is only recalculated at column top and at each of these surfaces: Ground below air, water below air, ground below water. The selected biome then stays in effect for all nodes below until column base or the next biome recalculation.

  • heat_point — Characteristic average temperature for the biome.
  • humidity_point — Characteristic average humidity for the biome.

Characteristic average temperature and humidity create 'biome points' on a voronoi diagram that has heat and humidity as axes. The resulting voronoi cells determine which heat/humidity points belong to which biome, and therefore determine the area and location of each biome in the world. The biome points need to be carefully and evenly spaced on the voronoi diagram to result in roughly equal size biomes. Heat and humidity have average values of 50, vary mostly between 0 and 100 but also often exceed these values. Heat is not in degrees celcius, both values are abstract.

This article is incomplete.

Personal tools