<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://olddev.minetest.org/index.php?action=history&amp;feed=atom&amp;title=Schematic</id>
	<title>Schematic - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://olddev.minetest.org/index.php?action=history&amp;feed=atom&amp;title=Schematic"/>
	<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Schematic&amp;action=history"/>
	<updated>2026-04-14T23:47:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.7</generator>
	<entry>
		<id>https://olddev.minetest.org/index.php?title=Schematic&amp;diff=296&amp;oldid=prev</id>
		<title>&gt;Rubenwardy at 11:17, 1 May 2023</title>
		<link rel="alternate" type="text/html" href="https://olddev.minetest.org/index.php?title=Schematic&amp;diff=296&amp;oldid=prev"/>
		<updated>2023-05-01T11:17:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Schematics''' are pre-defined node patterns to be placed somewhere in the world. They allow to create some complex figures or structures and repeat them with little random alterations.&lt;br /&gt;
&lt;br /&gt;
A schematic tells in an area what nodes should be created, with a given probability for each node to appear.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
Schematics save the contents of an area of the world. It saves node names and the param2 value for each node. Node metadata is '''not''' saved.&lt;br /&gt;
&lt;br /&gt;
Additional, schematics have the following features:&lt;br /&gt;
&lt;br /&gt;
* Specify a probability for every node to be placed (or not be placed)&lt;br /&gt;
* Specify a probability for each Y layer to be placed (or be removed entirely)&lt;br /&gt;
* Set certain nodes to be force-placed (thus overwriting any node when the schematic is placed&lt;br /&gt;
&lt;br /&gt;
== Schematic specifier ==&lt;br /&gt;
&lt;br /&gt;
Functions that use schematics are passed a schematic specifier. A specifier can have 3 forms:&lt;br /&gt;
&lt;br /&gt;
* A .mts file name as a string (see [[Minetest_Schematic_File_Format]])&lt;br /&gt;
* A raw data table&lt;br /&gt;
* A registered schematic identifier as a number, returned by ''minetest.register_schematic''&lt;br /&gt;
&lt;br /&gt;
=== Schematic file ===&lt;br /&gt;
You can write mts files in-game with the [https://content.minetest.net/packages/Wuzzy/schemedit/ Schematic Editor] mod or with [https://minetest.gitlab.io/minetest/minetest-namespace-reference/#schematics ''minetest.create_schematic''].&lt;br /&gt;
&lt;br /&gt;
=== Schematic table ===&lt;br /&gt;
&lt;br /&gt;
The schematic table has 2 mandatories attributes and 1 optional&lt;br /&gt;
&lt;br /&gt;
* ''size'': the bounding box in nodes, a 3D vector&lt;br /&gt;
* ''data'': the flat list of ''MapNode'' to write&lt;br /&gt;
&lt;br /&gt;
[[File:leftHandedCoordinates.png|thumb|Left-Handed Coordinate System (x=red,y=green,z=blue)]]&lt;br /&gt;
&lt;br /&gt;
The data list is ordered in z, y, x. Than means for a 3x3x3 box it will be a list of 27 MapNodes.&lt;br /&gt;
&lt;br /&gt;
* The first 3 are positioned at the stone block, at the node between and at the blue block,&lt;br /&gt;
* The next 3 are just above the 3 previous,&lt;br /&gt;
* The next is at the green block and the 2 next going toward the blue box, on top,&lt;br /&gt;
* The next 9 are the same pattern one node toward the red block,&lt;br /&gt;
* And finally the next 9 are the same pattern starting at the red block&lt;br /&gt;
&lt;br /&gt;
Each ''MapNode'' holds the node name and the probability to appear. ''See [https://github.com/minetest/minetest/blob/master/doc/lua_api.md#schematic-specifier Schematic specifier in lua_api.md]'' for more details.&lt;br /&gt;
&lt;br /&gt;
A minimal table for a 3x3 bush sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;local my_schematic = {&lt;br /&gt;
	size = {x = 3, y = 3, z = 3},&lt;br /&gt;
	data = {&lt;br /&gt;
		-- The side of the bush, with the air on top&lt;br /&gt;
		{name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, -- lower layer&lt;br /&gt;
		{name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, -- middle layer&lt;br /&gt;
		{name = &amp;quot;air&amp;quot;}, {name = &amp;quot;air&amp;quot;}, {name = &amp;quot;air&amp;quot;}, -- top layer&lt;br /&gt;
		-- The center of the bush, with stem at the base and a pointy leave 2 nodes above&lt;br /&gt;
		{name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_stem&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, -- lower layer&lt;br /&gt;
		{name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, -- middle layer&lt;br /&gt;
		{name = &amp;quot;air&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;air&amp;quot;}, -- top layer&lt;br /&gt;
		-- The other side of the bush, same as first side&lt;br /&gt;
		{name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, -- lower layer&lt;br /&gt;
		{name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, {name = &amp;quot;default:bush_leaves&amp;quot;}, -- middle layer&lt;br /&gt;
		{name = &amp;quot;air&amp;quot;}, {name = &amp;quot;air&amp;quot;}, {name = &amp;quot;air&amp;quot;}, -- top layer&lt;br /&gt;
	}&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can then provide ''my_schematic'' everytime a Schematic specifier is requested, for example in ''minetest.register_decoration''.&lt;br /&gt;
&lt;br /&gt;
== Placing schematics ==&lt;br /&gt;
&lt;br /&gt;
Schematics are placed either with ''minetest.place_schematic'' or at world generation with ''minetest.register_decoration''.&lt;br /&gt;
&lt;br /&gt;
When using ''minetest.register_decoration'', be aware that the decoration is placed inside a ground node and not on top, unlike simple decorations. You may want to add one layer for the roots of the schematic. See also in ''lua_doc.txt'' about the documentation of ''minetest.register_decoration'' for the flags to center the schematic on certain axes instead of placing it from a corner. Notice that you can only place the schematic from the center or the start of every axis and not an arbitrary offset.&lt;br /&gt;
&lt;br /&gt;
When using ''minetest.place_schematic'', you can provide the offset manually by changing the reference ''pos''.&lt;br /&gt;
&lt;br /&gt;
== Incomplete ==&lt;br /&gt;
&lt;br /&gt;
{{Incomplete}}&lt;br /&gt;
Missing some explainations about yslice_prob against individual node probability&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Core Engine]]&lt;/div&gt;</summary>
		<author><name>&gt;Rubenwardy</name></author>
	</entry>
</feed>