Aliases of itemnames can be added by using minetest.register_alias(alias, original_name) or minetest.register_alias_force(alias, original_name).

This adds an alias alias for the item called original_name. From now on, you can use alias to refer to the item original_name.

The only difference between minetest.register_alias and minetest.register_alias_force is that if an item named alias already exists, minetest.register_alias will do nothing while minetest.register_alias_force will unregister it.

This can be used for maintaining backwards compatibility.

This can also set quick access names for things, e.g. if you have an item called epiclylongmodname:stuff, you could do

minetest.register_alias("stuff", "epiclylongmodname:stuff")

and be able to use /giveme stuff.

Mapgen aliases

In a game, a certain number of these must be set to tell core mapgens which of the game's nodes are to be used for core mapgen generation. For example:

minetest.register_alias("mapgen_stone", "default:stone")

Aliases for non-V6 mapgens

Essential aliases

  • mapgen_stone
  • mapgen_water_source
  • mapgen_river_water_source

mapgen_river_water_source is required for mapgens with sloping rivers where it is necessary to have a river liquid node with a short liquid_range and liquid_renewable = false to avoid flooding.

Optional aliases

  • mapgen_lava_source

Fallback lava node used if cave liquids are not defined in biome definitions. Deprecated for non-V6 mapgens, define cave liquids in biome definitions instead.

  • mapgen_cobble

Fallback node used if dungeon nodes are not defined in biome definitions. Deprecated for non-V6 mapgens, define dungeon nodes in biome definitions instead.

Aliases needed for Mapgen V6

  • mapgen_stone
  • mapgen_water_source
  • mapgen_lava_source
  • mapgen_dirt
  • mapgen_dirt_with_grass
  • mapgen_sand
  • mapgen_gravel
  • mapgen_desert_stone
  • mapgen_desert_sand
  • mapgen_dirt_with_snow
  • mapgen_snowblock
  • mapgen_snow
  • mapgen_ice

  • mapgen_tree

  • mapgen_leaves
  • mapgen_apple
  • mapgen_jungletree
  • mapgen_jungleleaves
  • mapgen_junglegrass
  • mapgen_pine_tree
  • mapgen_pine_needles

  • mapgen_cobble

  • mapgen_stair_cobble
  • mapgen_mossycobble
  • mapgen_stair_desert_stone

Setting the node used in Mapgen Singlenode

By default the world is filled with air nodes. To set a different node use, for example:

minetest.register_alias("mapgen_singlenode", "default:stone")