![]() |
VOOZH | about |
This tutorial explains how to add a new custom dimension to a world using a data pack. It assumes you already know how to create a data pack.
pack.mcmeta{ "pack":{ "description":"Example description of a datapack!", "pack_format":88 } }
Adding a new dimension is as simple as creating one file in the data pack. This first dimension adds a new superflat world using the flat chunk generator.
data/tutorial/dimension/example_world.json{ "type":"minecraft:overworld", "generator":{ "type":"minecraft:flat", "settings":{ "biome":"minecraft:plains", "layers":[ { "block":"minecraft:stone", "height":64 } ], "structure_overrides":[] } } }
When adding to an existing world, make sure to leave and reopen the world! A warning screen will ask you to confirm using experimental world settings. It means that new versions can break existing world generation data packs without warning. You can click "I know what I'm doing!".
Now you can use /execute in tutorial:example_world run tp @s ~ ~ ~ to teleport yourself to this new dimension.
The settings can be further customized:
The example above used "type":"minecraft:overworld". This is a reference to the dimension type of the dimension. Dimensions are made up of two parts:
If you want to modify the properties of the dimension, a new file can be created in a dimension_type folder. In this example the [Int] min_y and [Int] height properties been modified, compared to the overworld dimension type. These control the build limit of the dimension.
data/tutorial/dimension_type/example_world.json{ "ultrawarm":false, "natural":true, "piglin_safe":false, "respawn_anchor_works":false, "bed_works":true, "has_raids":true, "has_skylight":true, "has_ceiling":false, "coordinate_scale":1, "ambient_light":0, "logical_height":256, "effects":"minecraft:overworld", "infiniburn":"#minecraft:infiniburn_overworld", "min_y":0, "height":256, "monster_spawn_light_level":{ "type":"minecraft:uniform", "min_inclusive":0, "max_inclusive":7 }, "monster_spawn_block_light_limit":0 }
To make a dimension use your newly created dimension type, the dimension file needs to be updated to reference this new dimension type:
data/tutorial/dimension/example_world.json{ "type":"tutorial:example_world", "generator":{ // ... } }
false) Whether this dimension has fixed time. โ[more information needed]max( skyLight - 10, blockLight ) during thunderstorms, and max( internalSkyLight, blockLight ) during other weather.
#. Fires on these blocks burns infinitely.overworld) The skybox to use. Can be none overworld end.default) Direction of cardinal light affecting blocks. Can be default nether/time command, and the minecraft:wake_up_from_sleep and minecraft:roll_village_siege time markers of this clock will be used. If not specified, the dimension doesn't have a default clock.#, or an [NBT List / JSON Array] array containing [String] IDs) that are active in this dimension.To have overworld-like terrain in the custom dimension, the noise generator type can be used.
data/tutorial/dimension/example_world.json{ "type":"tutorial:example_world", "generator":{ "type":"minecraft:noise", "settings":"minecraft:overworld", "biome_source":{ "type":"minecraft:fixed", "biome":"minecraft:plains" } } }
The above example reused the minecraft:overworld noise settings, which assume the world stretches from Y=-64 to Y=320. It also includes unnecessary logic for vanilla biomes. To customize the noise settings a file can be created in worldgen/noise_settings. This example changes the base to calcite, disables ore veins, and adds a grass block layer on top of the surface.
Because this file is very large by default, it is best to start from the vanilla files. You have a few options:
data/tutorial/worldgen/noise_settings/example_world.json{ "sea_level":63, "disable_mob_generation":false, "aquifers_enabled":true, "ore_veins_enabled":false, "legacy_random_source":false, "default_block":{ "Name":"minecraft:calcite" }, "default_fluid":{ "Name":"minecraft:water", "Properties":{ "level":"0" } }, "noise":{ "min_y":0, "height":256, "size_horizontal":1, "size_vertical":2 }, "noise_router":{ // ... (keep the same as the vanilla overworld) }, "spawn_target":[], "surface_rule":{ "type":"minecraft:condition", "if_true":{ "type":"minecraft:stone_depth", "offset":0, "surface_type":"floor", "add_surface_depth":false, "secondary_depth_range":0 }, "then_run":{ "type":"minecraft:block", "result_state":{ "Name":"minecraft:grass_block", "Properties":{ "snowy":"false" } } } } }
data/tutorial/dimension/example_world.json{ "type":"tutorial:example_world", "generator":{ "type":"minecraft:noise", "settings":"tutorial:example_world", "biome_source":{ "type":"minecraft:fixed", "biome":"minecraft:plains" } } }
((x^2+z^2)^2) / 390625 + (the square of the mininum distance to the ranges in the list). The player spawns near the location where this value is smallest.
min_y + height cannot exceed 2032.In the last step the noise router was left untouched from the vanilla overworld. But this creates a problem at the bottom of the world since this custom dimension starts at Y=0 and the noise router still assumes it starts at Y=-64. This causes holes at the bottom of the world where the void is exposed.
The fix is in final_density in the noise router. Two fixes need to be made. Find the following pieces of code inside the noise settings file and replace it with the fixed versions. The first issue can also be fixed in the initial_density_without_jaggedness part of the noise router on line 74, but this is less critical. The second fix disables noodle caves.
| Before | After |
|---|---|
"argument1":{ "type":"minecraft:y_clamped_gradient", "from_y":-64, "to_y":-40, "from_value":0, "to_value":1 }, |
"argument1":{ "type":"minecraft:y_clamped_gradient", "from_y":0, "to_y":24, "from_value":0, "to_value":1 }, |
"argument2":"minecraft:overworld/caves/noodle" |
"argument2":1
|
Right now the only surface blocks are calcite and grass blocks. You can add a dirt layer below the grass blocks and a bedrock gradient at the bottom of the world with some more complicated surface rules.
data/tutorial/worldgen/noise_settings/example_world.json{ // ... "surface_rule":{ "type":"minecraft:sequence", "sequence":[ { "type":"minecraft:condition", "if_true":{ "type":"minecraft:vertical_gradient", "random_name":"minecraft:bedrock_floor", "true_at_and_below":{ "above_bottom":0 }, "false_at_and_above":{ "above_bottom":5 } }, "then_run":{ "type":"minecraft:block", "result_state":{ "Name":"minecraft:bedrock" } } }, { "type":"minecraft:condition", "if_true":{ "type":"minecraft:stone_depth", "offset":0, "surface_type":"floor", "add_surface_depth":false, "secondary_depth_range":0 }, "then_run":{ "type":"minecraft:block", "result_state":{ "Name":"minecraft:grass_block", "Properties":{ "snowy":"false" } } } }, { "type":"minecraft:condition", "if_true":{ "type":"minecraft:stone_depth", "offset":0, "surface_type":"floor", "add_surface_depth":true, "secondary_depth_range":0 }, "then_run":{ "type":"minecraft:block", "result_state":{ "Name":"minecraft:dirt" } } } ] } }
The example dimension is still using the minecraft:plains biome. To change grass color, structures, features, spawning rules, and more you need a custom biome. This example adds the tutorial:plains biome, which modifies the grass and foliage colors.
A few features are added in the 10th decoration step, which is vegetal_decoration. If you want to add ores, they would go in step 7: underground_ores.
data/tutorial/worldgen/biome/plains.json{ "temperature":0.8, "downfall":0.4, "has_precipitation":true, "effects":{ "sky_color":7907327, "fog_color":12638463, "water_color":4159204, "water_fog_color":329011, "grass_color":10073398, "foliage_color":13127730 }, "spawners":{}, "spawn_costs":{}, "carvers":[], "features":[ [], [], [], [], [], [], [], [], [], [ "minecraft:glow_lichen", "minecraft:trees_plains", "minecraft:patch_grass_plain", "minecraft:patch_sugar_cane" ], [] ] }
data/tutorial/dimension/example_world.json{ "type":"tutorial:example_world", "generator":{ "type":"minecraft:noise", "settings":"tutorial:example_world", "biome_source":{ "type":"minecraft:fixed", "biome":"tutorial:plains" } } }
| Tutorials | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||
| |||||||||||||||||||