minetest.place schematic

From Minetest Developer Wiki
Jump to: navigation, search

Contents

Syntax

minetest.place_schematic(pos, schematic, rotation, replacements, force_placement)

Description

  • Places the schematic specified by schematic (see: Schematic specifier) at pos.
  • Rotation can be "0", "90", "180", "270", or "random".
  • If the rotation parameter is omitted, the schematic is not rotated.
  • replacements = {["old_name"] = "convert_to", ...}
  • force_placement is a boolean indicating whether nodes other than air and ignore are replaced by the schematic


note.png
Note: Schematics are volumes and the position where you place the schematic is the corner of the schematic. If for example you have a 5 by 5 by 5 schematic of a tree whose trunk is in the middle, you will need to offset the x and z position by -2. If you don't, you risk misplacing the tree causing them to float in the air or be generated inside blocks on e.g. steep slopes.


Example

The below snippet places the aspen tree from default at 10, 0, -10 with a random rotation, and not specific or general node replacements. Note that the trunk will therefore be placed at 12, 0, 8:

minetest.place_schematic({ x = 10, y = 0, z = -10 }, minetest.get_modpath("default").."/schematics/aspen_tree.mts"}, "random", nil, false)


See also

minetest.place_schematic_on_vmanip (https://github.com/minetest/minetest/commit/1384108f8c32f309852c1d1665a613f2a3e3fcc2)

Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox