A data pack or datapack is a collection of data used to configure a number of features of Minecraft. A data pack is either a folder or a .zip file containing a pack.mcmeta file. Data packs are used to define among others advancements, dimensions, enchantments, loot tables, recipes, structures, and biomes (see ยง Contents for a full list). The definitions of the vanilla features is done using a built-in data pack. Experiments are enabled by adding separate bundled data packs to a world. Similarly, custom data packs can be added to a world to add or modify features and define functions. A datapack can also change/edit terrain.
Data packs can be added to a world during world creation in the Create New World screen in the More tab by clicking the Data Packs button. This menu allows drag-and-drop of data packs from a file explorer. Alternatively, data packs can be added to an existing world by manually placing them in the .minecraft/saves/<world>/datapacks folder of a world.
Data packs load their data based on the load order. This order can be seen and altered in the Data Packs screen during world creation, and by using the /datapack command. The loading order of data packs is stored in the level.dat file. If a file exists in multiple data packs only the file in the last data pack is used. This is often referred to this file overriding the files in the earlier packs. However, tag files without "replace": true merge their content with the files loaded from earlier packs.
If a data pack is corrupted, broken or contains malformed entries that can't simply be ignored by the game (such as by adding a non-existent entry in a vanilla tag), an error is shown when trying to open the world that asks the player if they want to enable Safe Mode, or return to title and fix the issue. Safe Mode disables all data packs except the vanilla one, possibly allowing the world to be opened.
๐ Image The warning screen that appears when trying to open a world using experimental settings in singleplayer.
Some data pack features are considered experimental settings by the game. If a world has enabled a data pack that uses these features, opening the world in singleplayer will display a warning screen to the player. Additionally, worlds using experimental settings cannot be played on Realms: Attempting to upload such a world to Realms results in a server error.
Internally, most experimental settings use dynamic registries (as opposed to static registries). This means any changes regarding these features cannot be loaded using the /reload command: the world must be exited and reopened (singleplayer), or the server rebooted (multiplayer) for the changes to take effect.
For a data pack to be marked as "using experimental settings", it must contain at least one valid file inside one of several specific folders. For instance, defining a custom instrument inside the data/instrument/ folder counts as using experimental settings, whereas defining an instrument through item componentsdoes not count as such.
See ยง Folder structure for which folders are considered experimental settings.
Data packs use a folder structure to contain the data. On the top level, a data pack has to contain a pack.mcmeta file containing meta-data about the data pack. The data is organized into namespaces to avoid files from different packs unintentionally interfering with each other. Files are loaded as follows:
The file data/<namespace>/<registry name>/<path>.json is loaded into the <registry name> registry with ID <namespace>:<path>. Both <registry name> and <path> can contain slashes (/), which results in extra sub-folders.
If a folder is marked with an asterisk (*), it means that the game considers the feature to be experimental, and having a valid file inside any of these folders will mark the data pack as using experimental settings.
A data pack is identified by Minecraft based on the presence of the pack.mcmeta file in the root directory of the data pack, which contains data in JSON format.
A pack.mcmeta file to produce a data pack that looks like the "vanilla" data pack in 1.21.9 would look like this:
The /locate command now takes a configured structure as its first parameter rather than a structure type, so many grouped structures now require a structure type tag. E.g. /locate village is now /locate #village.
Commands that place blocks, such as /setblock, now have a strict argument.
Pig, frog, chicken and cow variants are now data-driven.
The [NBT List / JSON Array] ArmorItems, [NBT List / JSON Array] HandItems, [NBT Compound / JSON Object] body_armor_item, [NBT Compound / JSON Object] SaddleItem, and [Boolean] Saddle NBT tags were removed and merged into the [NBT Compound / JSON Object] equipment field.
The [Int] SpawnX, [Int] SpawnY, [Int] SpawnZ, [Float] SpawnAngle, [String] SpawnDimension, and [Boolean] SpawnForced NBT tags were removed and merged into the [NBT Compound / JSON Object] respawn field.
Item components that had only two fields (with one of them being the [Boolean] show_in_tooltip) now have the other field inlined to top-level.
Removed hide_tooltip and hide_additional_tooltip components and [Boolean] show_in_tooltip field from all components in favor of the new tooltip_display component.
Many changes have been made to entities and block entities' NBT data.
Dimension type definitions have a new optional field, cloud_height that indicates what Y-level the clouds start in the dimension.
The [NBT Compound / JSON Object] Particle field has been renamed to [NBT Compound / JSON Object] custom_particle, and now always functions as an exact override for the default colored entity_effect particle.
Added various things related to sulfur cubes, including the minecraft:sulfur_cube_archetyperegistry and sulfur_cube_contentdata component.
For configured features and dimension types, cannot_replace, invalid_blocks, root_replaceable, replaceable and infiniburn now also accept an ID and or a list of IDs in addition to a tag.
The entity predicate format has changed from a structure with multiple optional fields to one similar to data component maps. Unknown fields are now rejected rather than ignored.