Skip to content

How to make a new dimension in a Minecraft mod

A dimension is data. A dimension type file sets the rules (sky, height, whether beds work). A dimension file picks that type, the world generator and the biome. Both live in your mod’s data folder and the game loads them with the world, so nothing needs registering in Java.

Works on Minecraft 1.20.1 to 26.3 on NeoForge; Minecraft 1.16.5 to 26.3 on Fabric; Minecraft 1.16.5 to 1.20.1 on Forge. Each example was compiled against its loader and version before it shipped in Linen.

  1. Add a dimension type file in data/<your mod>/dimension_type.
  2. Add a dimension file with the same name in data/<your mod>/dimension. It names the type, the generator and the biome.
  3. Start a world and run /execute in <your mod>:<name> run tp @s 0 100 0 to go there.
  4. For a portal or any other way in, call ServerPlayer#teleportTo with the dimension’s ServerLevel from your own code.

The example uses these values. Change them in the code.

Setting In the example What it does
biome plains The one biome the whole dimension uses.

The example mod is examplemod in the package com.example.examplemod. Use your own mod id and package.

Fabric and NeoForge 1.20.4 to 1.21.1, NeoForge 1.20.1 to 1.20.2, Fabric 1.16.5 to 1.20.3, Fabric and NeoForge 1.21.2 to 1.21.10, Forge 1.17.1 to 1.20.1

Section titled “Fabric and NeoForge 1.20.4 to 1.21.1, NeoForge 1.20.1 to 1.20.2, Fabric 1.16.5 to 1.20.3, Fabric and NeoForge 1.21.2 to 1.21.10, Forge 1.17.1 to 1.20.1”

Uses:

  • Registries.DIMENSION
  • Registries.DIMENSION_TYPE
  • minecraft:noise
  • minecraft:fixed

src/main/resources/data/examplemod/dimension_type/mirror_realm.json

{
"ultrawarm": false,
"natural": true,
"coordinate_scale": 1.0,
"has_skylight": true,
"has_ceiling": false,
"ambient_light": 0.1,
"piglin_safe": false,
"bed_works": true,
"respawn_anchor_works": false,
"has_raids": false,
"logical_height": 384,
"min_y": -64,
"height": 384,
"infiniburn": "#minecraft:infiniburn_overworld",
"effects": "minecraft:overworld",
"monster_spawn_light_level": 7,
"monster_spawn_block_light_limit": 0
}

src/main/resources/data/examplemod/dimension/mirror_realm.json

{
"type": "examplemod:mirror_realm",
"generator": {
"type": "minecraft:noise",
"settings": "minecraft:overworld",
"biome_source": {
"type": "minecraft:fixed",
"biome": "minecraft:plains"
}
}
}

Uses:

  • Registries.DIMENSION
  • Registries.DIMENSION_TYPE
  • minecraft:noise
  • minecraft:fixed

src/main/resources/data/examplemod/dimension_type/mirror_realm.json

{
"coordinate_scale": 1.0,
"has_skylight": true,
"has_ceiling": false,
"ambient_light": 0.1,
"logical_height": 384,
"min_y": -64,
"height": 384,
"infiniburn": "#minecraft:infiniburn_overworld",
"monster_spawn_light_level": 7,
"monster_spawn_block_light_limit": 0,
"attributes": {
"minecraft:visual/sky_color": "#78a7ff",
"minecraft:visual/fog_color": "#c0d8ff",
"minecraft:gameplay/respawn_anchor_works": false,
"minecraft:gameplay/nether_portal_spawns_piglin": false
},
"timelines": "#minecraft:in_overworld"
}

src/main/resources/data/examplemod/dimension/mirror_realm.json

{
"type": "examplemod:mirror_realm",
"generator": {
"type": "minecraft:noise",
"settings": "minecraft:overworld",
"biome_source": {
"type": "minecraft:fixed",
"biome": "minecraft:plains"
}
}
}

Uses:

  • DimensionType
  • minecraft:noise
  • minecraft:fixed

The biome choices snowy_plains and cherry_grove do not exist in 1.16.5: use snowy_tundra or another vanilla biome. The noise generator needs a seed.

src/main/resources/data/examplemod/dimension_type/mirror_realm.json

{
"ultrawarm": false,
"natural": true,
"coordinate_scale": 1.0,
"has_skylight": true,
"has_ceiling": false,
"ambient_light": 0.1,
"piglin_safe": false,
"bed_works": true,
"respawn_anchor_works": false,
"has_raids": false,
"logical_height": 256,
"infiniburn": "minecraft:infiniburn_overworld",
"effects": "minecraft:overworld"
}

src/main/resources/data/examplemod/dimension/mirror_realm.json

{
"type": "examplemod:mirror_realm",
"generator": {
"type": "minecraft:noise",
"seed": 0,
"settings": "minecraft:overworld",
"biome_source": {
"type": "minecraft:fixed",
"biome": "minecraft:plains"
}
}
}

Linen’s How-tos library has this page too, with the example for your own mod’s loader and Minecraft version. Hover a name in your code and Linen points to the how-tos that explain it. Both are free. Download Linen.