Skip to content

Datapack Changes in Version 2.3.x

xyroc edited this page Jul 29, 2021 · 10 revisions

Keys

IDs are no longer the primary way to indentify themes and the like. 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.

The namespace is the name of the directory inside the data directory of your datapack:

  • data
    • dungeoncrawl <- The namespace, "dungeoncrawl" in this case.
      • datapack contents

The path is the bit that comes after the namespace directory:

  • data
    • somedatapack
      • my_directory <- the path begins here
        • file.txt

The key for file.txt would be somedatapack:my_directory/file.txt

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

  • The file ending is 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, the loot_tables directory can simply be left out to keep it simple. However, this does not mean that you can leave out any directory simply because all of your files are inside of it.

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
          • secondary
            • contains mappings that map biomes to secondary themes
  • In addition, mappings no longer map biomes directly to themes / randomizers, but to a whole list of 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. You can also leave the weight out. A weight value of 1 will be used in that case.

Primary Themes

Secondary Themes

Clone this wiki locally