Wiki 9Minecraft Dungeon Crawl Wiki
Dungeon Crawl WikiDocumentation › 2.3.X Theming

2.3.X Theming

Theming

When creating custom themes, they should be stored in data/your_datapack_name/theming. They are divided down into 5 parts:

  • Primary: The first layer of the dungeon
  • Secondary: The second layer of the dungeon
  • Upper Catacombs: The third layer of the dungeon
  • Lower Catacombs: The fourth layer of the dungeon
  • Hell: The fifth and final layer of the dungeon

Datapack Layout:

< Name of Datapack >
├-- pack.mcmeta
└-- data
    └-- your_datapack_name
        └-- theming
            └-- lower_layers
            |   └-- catacombs
            |   |   └-- your_catacombs_theme_name.json
            |   └-- hell
            |   |   └-- your_hell_theme_name.json
            |   └-- upper_catacombs
            |   |   └-- your_upper_catacombs_theme_name.json
            └-- primary_themes
            |   └-- your_primary_theme_name.json
            └-- secondary_themes
                └-- your_secondary_theme_name.json

Primary Theme

Going from top to bottom, lets explore all the components of this primary theme file. You'll find that some parts have both a solid and a non-solid option. Solid blocks replace air during the dungeon generation while non-solid ones do not.

JSON Name Structure NBT Name Description
generic GENERIC Non-Solid blocks generally used for the outside decoration of the dungeon
solid SOLID All the solid blocks of the structure (Mainly the entrance)
pillar PILLAR The "supports" of the rooms in the structure
floor FLOOR The floor of the rooms (non-solid)
stairs STAIRS Generally the decorative stairs in rooms (non-solid)
solid_stairs SOLID_STAIRS Generally found on the entrance and the area leading down to the first floor of the structure
material The blocks that spawn in a loot chest pertaining to the blocks used in the structure
slab SLAB Decorative slabs in certain rooms of the structure (non-solid)
solid_slab SOLID_SLAB Generally found on the entrance of the dungeon
wall WALL walls in certain rooms (non-solid)
fencing FENCING The solid fences/iron bars that separate the stairs room from the rest of the floor
fluid FLUID The solid fluid found in certain rooms

Each line in your theme block should look something like this:

"<block theme type name>": {
	"type": "block",
	"block": "minecraft:cobblestone"
}

If the type is instead random_block, a list of blocks will be used based upon their weights, like so:

"<block theme type name>": {
	"type": "random_block",
	"blocks": [
		{"block": "minecraft:oak_planks", "weight": 50},
		{"block": "minecraft:diamond_block", "weight": 2},
		{"block": "minecraft:tnt", "weight": 4}
	]
}

Another type you can use is pattern. This will call a selected pattern to choose when generating a specific part of a dungeon. The two types of patterns currently are the checkerboard and terracotta patterns.

checkerboard takes in two blocks, block_1 and block_2 for generating the pattern.

terracotta takes in only one block, block, and if it detects any glazed terracotta, it will rotate the block appropriately to generate a mosaic pattern.

Checkerboard example

Terracotta example

Keep in mind, fencing still has to be a fence, slab has to be a slab, etc, or else the structure generator will have issues placing blocks in your dungeon!

Requirements

This file also has optional configuration to allow for mod-specific themes. For example:

{
  "requirements": {
    "present": ["twilightforest"]
  }
}

This example will make is so that this theme only is used when Twilight Forest is present.

Decorations

Dungeons can be post-processed with additional decorations for an extra bit of flare.

Default types:

  • vines
  • scattered
  • floor
  • floor_next_to_solid
"decorations": [
    {"type": "vines"}
]

Adds the "vines" decoration type to the dungeon. See here for additional configuration options per decoration.

Specifying Secondary Themes

If you wish for a specific secondary theme to be created alongside the primary theme, you can add an optional requirement for it here. This only works one way, meaning primary theme A will always spawn secondary theme C, but secondary theme C can spawn with any other primary theme.

"secondary_theme": [
	{"key": "tutorial:custom_secondary_theme_dir/custom_secondary_theme_name"}
]

Configures this theme so that the custom theme custom_theme_dir/custom_theme_name will always spawn as the first few levels of the dungeon when this theme is used

Additionally, "weight" can be appended to the line to add a chance for this theme to be used, which only works when multiple themes can be used. If excluded, each listed theme has an equal chance of spawning.

Secondary Theme

Works similarly to primary themes, except has more finer options and works on lower levels.

JSON Name Description
pillar The "supports" of a room, generally rotatable/pillar blocks (e.g. logs)
trapdoor The trapdoor decoration that appears in rooms
door The door decoration that appears in rooms (for example, the iron doors in the catacomb layers)
material The blocks that spawn in a loot chest pertaining to the blocks used in the structure
stairs The stairs decoration in a room
slab The slab decoration in a room
fence General fence/bars decorations in a room
fence_gate Fence Gate decorations in a room
button Button decorations in a room (e.g. the wooden buttons next to doors)
pressure_plate Pressure Plate decorations in a room (e.g. the stone pressure plates behind doors in the catacomb layers)

Mappings

Mappings will define which type of your dungeon gets used in which biome. For this, there are two directories for the mappings, primary for primary themes and secondary for secondary themes. Here's an example taken from the vanilla default:

{
  "default": [
    {"key": "dungeoncrawl:vanilla/default", "weight": 2},
    {"key": "dungeoncrawl:vanilla/bricks", "weight": 1},
    {"key": "dungeoncrawl:vanilla/bricks_2", "weight": 1},
    {"key": "dungeoncrawl:vanilla/andesite", "weight": 2}
  ],
  "mapping": {
    "minecraft:jungle": [{"key": "dungeoncrawl:vanilla/jungle/default"}],
    "minecraft:sparse_jungle": [{"key": "dungeoncrawl:vanilla/jungle/default"}],
    "minecraft:bamboo_jungle": [{"key": "dungeoncrawl:vanilla/jungle/default"}],

    "minecraft:desert": [
      {"key": "dungeoncrawl:vanilla/desert/default"},
      {"key": "dungeoncrawl:vanilla/desert/granite"},
      {"key": "dungeoncrawl:vanilla/desert/diorite"}
    ],

    "minecraft:badlands": [{"key": "dungeoncrawl:vanilla/badlands/default"}],
    "minecraft:eroded_badlands": [{"key": "dungeoncrawl:vanilla/badlands/default"}],
    "minecraft:wooded_badlands": [{"key": "dungeoncrawl:vanilla/badlands/default"}],

    "minecraft:grove": [
      {"key": "dungeoncrawl:vanilla/mountains/default", "weight": 2}, {"key": "dungeoncrawl:vanilla/default"}
    ],
    "minecraft:snowy_slopes": [
      {"key": "dungeoncrawl:vanilla/mountains/default", "weight": 2}, {"key": "dungeoncrawl:vanilla/default"}
    ],
    "minecraft:frozen_peaks": [
      {"key": "dungeoncrawl:vanilla/mountains/default", "weight": 2}, {"key": "dungeoncrawl:vanilla/default"}
    ],
    "minecraft:jagged_peaks": [
      {"key": "dungeoncrawl:vanilla/mountains/default", "weight": 2}, {"key": "dungeoncrawl:vanilla/default"}
    ],
    "minecraft:stony_peaks": [
      {"key": "dungeoncrawl:vanilla/mountains/default", "weight": 2}, {"key": "dungeoncrawl:vanilla/default"}
    ],
    "minecraft:windswept_hills": [
      {"key": "dungeoncrawl:vanilla/mountains/default", "weight": 2}, {"key": "dungeoncrawl:vanilla/default"}
    ],
    "minecraft:windswept_gravelly_hills": [
      {"key": "dungeoncrawl:vanilla/mountains/default", "weight": 2}, {"key": "dungeoncrawl:vanilla/default"}
    ],
    "minecraft:windswept_forest": [
      {"key": "dungeoncrawl:vanilla/mountains/default", "weight": 2}, {"key": "dungeoncrawl:vanilla/default"}
    ],
    "minecraft:taiga": [
      {"key": "dungeoncrawl:vanilla/mountains/default"}, {"key": "dungeoncrawl:vanilla/default", "weight": 2}
    ],
    "minecraft:snowy_taiga": [
      {"key": "dungeoncrawl:vanilla/mountains/default"}, {"key": "dungeoncrawl:vanilla/default", "weight": 2}
    ],
    "minecraft:old_growth_spruce_taiga": [
      {"key": "dungeoncrawl:vanilla/mountains/default"}, {"key": "dungeoncrawl:vanilla/default", "weight": 2}
    ],
    "minecraft:old_growth_pine_taiga": [
      {"key": "dungeoncrawl:vanilla/mountains/default"}, {"key": "dungeoncrawl:vanilla/default", "weight": 2}
    ],

    "minecraft:swamp": [{"key": "dungeoncrawl:vanilla/catacombs/mossy"}]
  }
}

As we can see, there's two parts, default and mapping. The default specifies what the dungeon should choose for the theming in cases where the biome mapping isn't supplied. To configure your default mappings, it should be something similar to this:

"default": [{"key": "custom_theme_primary_dir/custom_theme_primary_name"}]

If you have multiple primary themes, they can be listed out, attaching a weight value to each one for a chanced-based, configurable option.

"default": [
	{"key": "custom_theme_primary_dir/custom_theme_primary_name", "weight": 2},
	{"key": "custom_theme_primary_dir/primary_foo", "weight": 6},
	{"key": "custom_theme_primary_dir/primary_weird_theme", "weight": 10}
]

The mapping section works similarly, except you take in biome names and associate theme values to each one:

"minecraft:plains": [{"key": "custom_theme_primary_dir/custom_theme_primary_name"}]

And, like before, these too can be expanded to include multiple, each to have a chance of spawning.

Additionally, requirements can be appended to the top of the file to specify conditions that should be met before choosing these mappings.