World structure¶
Warning
Contents of this article may be outdated.
This article was migrated from the old Mineclonia repo wiki and was last updated on January 20, 2025, before halon’s levelgen PR was merged. Once it’s actualized, this note should be removed.
Coordinates, blocks & chunks¶
The world is a cube with a side length of 61840 nodes.
Luanti worlds use x, y and z coordinates (y means an altitude) to define positions of nodes, blocks, objects, etc. The coordinates are usually integer (signed) for nodes and blocks, but can be float for the objects, entities and particles.
16x16x16 nodes means 1 map block. The size of map block is defined in ./builtin/game/constants.lua and probably shoudn’t be changed.
5x5x5 blocks means 1 map chunk (1 map chunk = 80x80x80 nodes). The size of map chunk is defined in ./builtin/settingtypes.txt in Advanced section and better shouldn’t be changed too.
Central map chunk has offset of -2 blocks (-32 nodes) and the position of central map chunk is always {x=-32, y=-32, z=-32} (first node) with the opposite corner at {x=47, y=47, z=47} (last node).
So the world coordinate system is asymmetrical.
You usually get started near the center of the world, ca. {x=0, y=0, z=0} (but in fact real center is something alike {x=7.5, y=7.5, z=7.5}). Boundaries
Each dimension (X, Y and Z) ranges from −30912 to 30927.
The range shouldn’t be decreased, because Y coordinate is used to simulate multiple dimensions of Minecraft. Dimensions
We currently have 3 dimensions: the Overworld, the Nether and the End. Each dimension occupies its own altitude:
Basic layer structure¶
Layer Name |
Formula based on mcl_vars.constants |
Rest of mapgens |
Classic Superflat |
Singlenode |
|||
|---|---|---|---|---|---|---|---|
Range |
Height |
Range |
Height |
Range |
Height |
||
Overworld |
mg_overworld_max |
30927 |
30994 |
30927 |
30990 |
30927 |
30993 |
… |
… |
… |
… |
||||
mg_bedrock_overworld_max+1 |
-123 |
6 |
-65 |
||||
Bedrock |
mg_bedrock_overworld_max |
-124 |
5 |
5 |
1 |
-66 |
1 |
… |
… |
… |
… |
||||
mg_overworld_min |
-127 |
5** |
-66 |
||||
Void |
mg_overworld_min-1 |
-128 |
1999 |
4 |
1999 |
-67 |
1999 |
… |
… |
… |
… |
||||
mg_end_max+1 |
-2061 |
-1994 |
-2065 |
||||
Realm Barrier |
mg_realm_barrier_overworld_end_max |
-2062 |
12 |
-1995 |
12 |
-2066 |
12 |
… |
… |
… |
… |
||||
mg_realm_barrier_overworld_end_min |
-2073 |
-2006 |
-2077 |
||||
Void |
mg_realm_barrier_overworld_end_min-1 |
-2074 |
-14 |
-2007 |
-14 |
-2078 |
-14 |
… |
… |
… |
… |
||||
mcl_vars.mg_end_max+1 |
-2061 |
-1994 |
-2065 |
||||
End* |
mg_end_max |
-2062 |
25012 |
-1995 |
25079 |
-2066 |
25007 |
… |
… |
… |
… |
||||
mg_end_min |
-27073 |
-27073 |
-27073 |
||||
Void |
mg_end_min-1 |
-27074 |
1737 |
-27074 |
1737 |
-27074 |
1737 |
… |
… |
… |
… |
||||
mg_nether_max+129 |
-28810 |
-28810 |
-28810 |
||||
Nether Roof |
mg_nether_max+128 |
-28811 |
128 |
-28811 |
128 |
-28811 |
128 |
… |
… |
… |
… |
||||
mg_nether_max+1 |
-28938 |
-28938 |
-28938 |
||||
Bedrock |
mg_bedrock_nether_top_max |
-28939 |
5 |
-28939 |
1 |
-28939 |
5 |
… |
… |
… |
… |
||||
mg_bedrock_nether_top_min |
-28943 |
-28939 |
-28943 |
||||
Nether |
mg_nether_max |
-28939 |
129 |
-28939 |
129 |
-28939 |
128 |
… |
… |
… |
… |
||||
mg_nether_min |
-29067 |
-29067 |
-29067 |
||||
Bedrock |
mg_bedrock_nether_bottom_max |
-29063 |
5 |
-29067 |
1 |
-29063 |
5 |
… |
… |
… |
… |
||||
mg_bedrock_nether_bottom_min |
-29067 |
-29067 |
-29067 |
||||
Void |
mg_nether_min-1 |
-29068 |
1845 |
-29068 |
1845 |
-29068 |
1845 |
… |
… |
… |
… |
||||
mapgen_edge_min |
-30912 |
-30912 |
-30912 |
||||
*Top 12 nodes of the End are Realm Barrier:
mg_realm_barrier_overworld_end_max = mg_end_max
mg_realm_barrier_overworld_end_min = mg_end_max - 11
**Calculates as: mgflat_ground_level (usually 8) - 3
Basic variables¶
Constant Name: mcl_vars.CONSTANT |
Rest of mapgens |
Classic Superflat |
Singlenode |
|---|---|---|---|
mapgen_edge_max |
30927 |
30927 |
30927 |
mg_overworld_max |
30927 |
30927 |
30927 |
mg_bedrock_overworld_max |
-58 |
5 |
-66 |
mg_bedrock_overworld_min |
-62 |
5 |
-66 |
mg_overworld_min |
-62 |
5 |
-66 |
mg_realm_barrier_overworld_end_max |
-2062 |
-1995 |
-2066 |
mg_end_max |
-2062 |
-1995 |
-2066 |
mg_end_min |
-27073 |
-27073 |
-27073 |
mg_bedrock_nether_top_max |
-28939 |
-28939 |
-28939 |
mg_nether_max |
-28939 |
-28939 |
-28939 |
mg_bedrock_nether_top_min |
-28943 |
-28939 |
-28943 |
mg_bedrock_nether_bottom_max |
-29063 |
-29067 |
-29063 |
mg_bedrock_nether_bottom_min |
-29067 |
-29067 |
-29067 |
mg_nether_min |
-29067 |
-29067 |
-29067 |
mapgen_edge_min |
-30912 |
-30912 |
-30912 |
Offsets of all chunks¶
It’s pretty easy to list all chunk positions with Lua:
local c = {}
for i = -30912, 30927, 80 do
table.insert(c, i)
end
print (tostring(#c) .. " chunks: " .. table.concat(c, ", "))
Resulting output
773 chunks: -30912, -30832, -30752, -30672, -30592, -30512, -30432, -30352, -30272, -30192, -30112, -30032, -29952, -29872, -29792, -29712, -29632, -29552, -29472, -29392, -29312, -29232, -29152, -29072, -28992, -28912, -28832, -28752, -28672, -28592, -28512, -28432, -28352, -28272, -28192, -28112, -28032, -27952, -27872, -27792, -27712, -27632, -27552, -27472, -27392, -27312, -27232, -27152, -27072, -26992, -26912, -26832, -26752, -26672, -26592, -26512, -26432, -26352, -26272, -26192, -26112, -26032, -25952, -25872, -25792, -25712, -25632, -25552, -25472, -25392, -25312, -25232, -25152, -25072, -24992, -24912, -24832, -24752, -24672, -24592, -24512, -24432, -24352, -24272, -24192, -24112, -24032, -23952, -23872, -23792, -23712, -23632, -23552, -23472, -23392, -23312, -23232, -23152, -23072, -22992, -22912, -22832, -22752, -22672, -22592, -22512, -22432, -22352, -22272, -22192, -22112, -22032, -21952, -21872, -21792, -21712, -21632, -21552, -21472, -21392, -21312, -21232, -21152, -21072, -20992, -20912, -20832, -20752, -20672, -20592, -20512, -20432, -20352, -20272, -20192, -20112, -20032, -19952, -19872, -19792, -19712, -19632, -19552, -19472, -19392, -19312, -19232, -19152, -19072, -18992, -18912, -18832, -18752, -18672, -18592, -18512, -18432, -18352, -18272, -18192, -18112, -18032, -17952, -17872, -17792, -17712, -17632, -17552, -17472, -17392, -17312, -17232, -17152, -17072, -16992, -16912, -16832, -16752, -16672, -16592, -16512, -16432, -16352, -16272, -16192, -16112, -16032, -15952, -15872, -15792, -15712, -15632, -15552, -15472, -15392, -15312, -15232, -15152, -15072, -14992, -14912, -14832, -14752, -14672, -14592, -14512, -14432, -14352, -14272, -14192, -14112, -14032, -13952, -13872, -13792, -13712, -13632, -13552, -13472, -13392, -13312, -13232, -13152, -13072, -12992, -12912, -12832, -12752, -12672, -12592, -12512, -12432, -12352, -12272, -12192, -12112, -12032, -11952, -11872, -11792, -11712, -11632, -11552, -11472, -11392, -11312, -11232, -11152, -11072, -10992, -10912, -10832, -10752, -10672, -10592, -10512, -10432, -10352, -10272, -10192, -10112, -10032, -9952, -9872, -9792, -9712, -9632, -9552, -9472, -9392, -9312, -9232, -9152, -9072, -8992, -8912, -8832, -8752, -8672, -8592, -8512, -8432, -8352, -8272, -8192, -8112, -8032, -7952, -7872, -7792, -7712, -7632, -7552, -7472, -7392, -7312, -7232, -7152, -7072, -6992, -6912, -6832, -6752, -6672, -6592, -6512, -6432, -6352, -6272, -6192, -6112, -6032, -5952, -5872, -5792, -5712, -5632, -5552, -5472, -5392, -5312, -5232, -5152, -5072, -4992, -4912, -4832, -4752, -4672, -4592, -4512, -4432, -4352, -4272, -4192, -4112, -4032, -3952, -3872, -3792, -3712, -3632, -3552, -3472, -3392, -3312, -3232, -3152, -3072, -2992, -2912, -2832, -2752, -2672, -2592, -2512, -2432, -2352, -2272, -2192, -2112, -2032, -1952, -1872, -1792, -1712, -1632, -1552, -1472, -1392, -1312, -1232, -1152, -1072, -992, -912, -832, -752, -672, -592, -512, -432, -352, -272, -192, -112, -32, 48, 128, 208, 288, 368, 448, 528, 608, 688, 768, 848, 928, 1008, 1088, 1168, 1248, 1328, 1408, 1488, 1568, 1648, 1728, 1808, 1888, 1968, 2048, 2128, 2208, 2288, 2368, 2448, 2528, 2608, 2688, 2768, 2848, 2928, 3008, 3088, 3168, 3248, 3328, 3408, 3488, 3568, 3648, 3728, 3808, 3888, 3968, 4048, 4128, 4208, 4288, 4368, 4448, 4528, 4608, 4688, 4768, 4848, 4928, 5008, 5088, 5168, 5248, 5328, 5408, 5488, 5568, 5648, 5728, 5808, 5888, 5968, 6048, 6128, 6208, 6288, 6368, 6448, 6528, 6608, 6688, 6768, 6848, 6928, 7008, 7088, 7168, 7248, 7328, 7408, 7488, 7568, 7648, 7728, 7808, 7888, 7968, 8048, 8128, 8208, 8288, 8368, 8448, 8528, 8608, 8688, 8768, 8848, 8928, 9008, 9088, 9168, 9248, 9328, 9408, 9488, 9568, 9648, 9728, 9808, 9888, 9968, 10048, 10128, 10208, 10288, 10368, 10448, 10528, 10608, 10688, 10768, 10848, 10928, 11008, 11088, 11168, 11248, 11328, 11408, 11488, 11568, 11648, 11728, 11808, 11888, 11968, 12048, 12128, 12208, 12288, 12368, 12448, 12528, 12608, 12688, 12768, 12848, 12928, 13008, 13088, 13168, 13248, 13328, 13408, 13488, 13568, 13648, 13728, 13808, 13888, 13968, 14048, 14128, 14208, 14288, 14368, 14448, 14528, 14608, 14688, 14768, 14848, 14928, 15008, 15088, 15168, 15248, 15328, 15408, 15488, 15568, 15648, 15728, 15808, 15888, 15968, 16048, 16128, 16208, 16288, 16368, 16448, 16528, 16608, 16688, 16768, 16848, 16928, 17008, 17088, 17168, 17248, 17328, 17408, 17488, 17568, 17648, 17728, 17808, 17888, 17968, 18048, 18128, 18208, 18288, 18368, 18448, 18528, 18608, 18688, 18768, 18848, 18928, 19008, 19088, 19168, 19248, 19328, 19408, 19488, 19568, 19648, 19728, 19808, 19888, 19968, 20048, 20128, 20208, 20288, 20368, 20448, 20528, 20608, 20688, 20768, 20848, 20928, 21008, 21088, 21168, 21248, 21328, 21408, 21488, 21568, 21648, 21728, 21808, 21888, 21968, 22048, 22128, 22208, 22288, 22368, 22448, 22528, 22608, 22688, 22768, 22848, 22928, 23008, 23088, 23168, 23248, 23328, 23408, 23488, 23568, 23648, 23728, 23808, 23888, 23968, 24048, 24128, 24208, 24288, 24368, 24448, 24528, 24608, 24688, 24768, 24848, 24928, 25008, 25088, 25168, 25248, 25328, 25408, 25488, 25568, 25648, 25728, 25808, 25888, 25968, 26048, 26128, 26208, 26288, 26368, 26448, 26528, 26608, 26688, 26768, 26848, 26928, 27008, 27088, 27168, 27248, 27328, 27408, 27488, 27568, 27648, 27728, 27808, 27888, 27968, 28048, 28128, 28208, 28288, 28368, 28448, 28528, 28608, 28688, 28768, 28848, 28928, 29008, 29088, 29168, 29248, 29328, 29408, 29488, 29568, 29648, 29728, 29808, 29888, 29968, 30048, 30128, 30208, 30288, 30368, 30448, 30528, 30608, 30688, 30768, 30848