Skip to content

Datapack Changes in Version 2.3.x

xyroc edited this page Nov 28, 2021 · 10 revisions

Keys

IDs are no longer the primary way to indentify themes. Instead, "keys" are used.

A key is a modified version of the path of a file inside a datapack. It consists of a namespace and a path: namespace:path.

However, we usually do not use the full path for the key, but a shortened version of it instead:

  • File endings are left out
  • Redundant directories at the beginning are left out.

A "redundant directory" is a directory that is included in every single path of a specific datapack content type.

For example, have a look at Minecraft's loot table structre:

data
 |-- minecraft
      |-- loot_tables    <- contains all loot tables

Since all loot tables have to be in the loot_tables directory or a subdirectory of it, all loot table paths would begin with loot_tables/, and therefore that part is simply left out.

However, this does not mean that you can leave out any directory only because all of your files are somewhere inside of it. The part of the path you have to leave out should be specified and is always the same.

Let's say we have two loot tables common_loot.json and rare_loot.json:

data
 |-- minecraft
      |-- loot_tables
           |-- common_loot.json
           |-- special
                |-- rare_loot.json

The key of common_loot.json would be minecraft:common_loot. Notice that the loot_tables directory and the file ending have been left out.

The key of rare_loot.json would be minecraft:special/rare_loot since the loot_tables directory can be left out, but any subdirectories still have to be included.

Theming

General Changes

  • "Themes" are now mostly referred to as "primary themes"
  • "Sub-Themes" are now referred to as "secondary themes"

Theme Randomizers

  • Removed

Theme Mappings

  • Theme Mappings have been moved to new directories. The folder structure for mappings now looks like this:
data
 |-- dungeoncrawl
      |-- theming
           |-- mappings
                |-- primary (contains mappings that map biomes to primary themes, short "primary mappings")
                |-- secondary (contains mappings that map biomes to secondary themes, short "secondary mappings")
  • In addition, mappings no longer map biomes directly to themes / randomizers, but to a whole list of weighted themes instead:

Old:

{
  "minecraft:jungle": 2
}

where 2 would be the id of a theme or a randomizer

New:

{
  "minecraft:jungle": [ { "key": "dungeoncrawl:vanilla/jungle/default", "weight": 1 } ]
}

Biomes are now mapped to a list of entries like this:

[
  {
    "key": "a key",
    "weight": 2
  },
  {
    "key": "another key",
    "weight": 1
  },
  {
    "key": "and another key",
    "weight": 1
  }
]

The key fields should hold the keys of primary or secondary themes, depending on which type of theme you are mapping to.

The weight fields hold the weights of those themes, just like the weights of items in a loot table. It is optional and will default to one if it is left out.

Primary and Secondary Themes

  • Added a new block type called pattern
    • Places blocks not randomly, but in a pattern
    • Supports multiple types:
      • checkerboard
        • Takes two block types and places them in a checkerboard pattern.
        • Note: the name of this type is inconsistent across different 2.3.x versions. Use checkerboard for version 2.3.3 and later.
      • terracotta
        • Places a terracotta block in a repeating pattern.
    • The type to be used has to be declared with the pattern_type field.
    • Implementation examples:
    {
         "type": "pattern",
         "pattern_type": "checkerboard",
         "block_1": {
              "type": "block",
              "block": "minecraft:light_blue_terracotta"
         },
         "block_2": {
              "type": "block",
              "block": "minecraft:white_terracotta"
         }
    }
    {
         "type": "pattern",
         "pattern_type": "terracotta",
         "block": {
              "type": "block",
              "block": "minecraft:red_glazed_terracotta"
         }
    }

Primary Themes

  • Primary themes (previously just "Themes") have been moved. They are now located in data/dungeoncrawl/theming/primary_themes/.
  • The type field (which previously declared if the file as a primary theme, secondary theme, randomizer or mapping) is no longer part of the file.
  • The id field is now optional. It should be kept for already existing themes, but left out of any new themes you create.
  • The sub_theme field was renamed to secondary_theme and takes an array of weighted secondary themes instead of a single id now. Example:
     "secondary_theme": [
          {"key": "dungeoncrawl:vanilla/default", "weight": 2},
          {"key": "dungeoncrawl:vanilla/bricks"}
     ]
  • Theme field changes:
    • normal
      • Renamed to generic
    • normal_2
      • Removed
    • fencing
      • New field
      • Used for fencings and barricades. Most themes use minecraft:iron_bars for it.
    • fluid
      • New field
      • Defines the fluid block to be used. Most themes use minecraft:water for it. Despite this being called "fluid", you can use any block for it.
    • pillar
      • New field
      • Used for pillars in rooms. Usually similar to the solid field.

Secondary Themes

  • Secondary themes (previously "Sub-themes") have been moved. They are now located in data/dungeoncrawl/theming/secondary_themes/.
  • The type field (which previously declared if the file as a primary theme, secondary theme, randomizer or mapping) is no longer part of the file.
  • The id field is now optional. It should be kept for already existing themes, but left out of any new themes you create.

Clone this wiki locally