Data pack

This article is about the data pack system. For the command, see Commands/datapack. For the resource pack system, see Resource pack.
This feature is exclusive to Java Edition.
 
There are related tutorial pages for this topic!
 
Some experimental vanilla datapacks and Terralith, which is a famous datapack that changes world generation.

A data pack 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.

Usage

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.

When adding or modifying a data pack while the world is loaded, changes done to registry tags, loot tables, recipes, advancements, item modifiers, predicates, functions, and structure templates can be loaded using the /reload command. Other features require the world or server to be rebooted for changes to take effect (see § Experimental Settings).

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.

Experimental Settings

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 components does not count as such.

See § Folder structure for which folders are considered experimental settings.

Contents

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.
  • Tags are loaded from files data/<namespace>/tags/<registry name>/<path>.json which results in a <registry name> tag named #<namespace>:<path>.

Folder structure

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.

pack.mcmeta

Main article: pack.mcmeta

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.7 would look this this:

pack.mcmeta

{
    "pack": {
        "description": {
            "translate": "dataPack.vanilla.description"
        },
        "pack_format": 81
    }
}

Pack format

For the full list of pack formats in all versions, see Pack format § List of data pack formats.
Data pack formats
Value Releases Significant/Breaking Changes
41.131.14.4
  • Added the initial pack format version of 4.
51.151.16.1
61.16.21.16.5
71.171.17.1
  • The /replaceitem command was replaced with /item.
  • The set_damage loot function now require a valid [String] type field.
81.181.18.1
  • Loot table functions set_contents and set_loot_table now require a [String] type field.
  • Removed length limits for scoreboards, score holders and team names.
91.18.2
  • 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.
101.191.19.3
  • Data packs can now have a [NBT Compound / JSON Object] filter section in pack.mcmeta.
  • Merged /locatebiome with /locate, changing its syntax.
121.19.4
  • Added damage types.
  • Removed all boolean flags in damage predicates, instead damage type tags can now be tested for.
  • Biome field [String] precipitation changed to [Boolean] has_precipitation.
151.201.20.1
  • Changed sign NBT. E.g. Text1 is now front_text.messages[0].
  • All fields in placed_block, item_used_on_block, and allay_drop_item_on_block advancement triggers have been collapsed to a single location field.
  • Renamed the alternative predicate to any_of.
181.20.2
  • Added function macros.
  • Effects now use namespaced IDs rather than numeric values in NBT. E.g. 1 is now minecraft:speed.
261.20.31.20.4
  • Text components are parsed more strictly.
  • Renamed grass block and item to short_grass.
  • Added scoreboard display names and number formats.
411.20.51.20.6
  • Renamed the sweeping enchantment to sweeping_edge.
  • Changed the behavior of the item_used_on_block advancement trigger.
  • Replaced some behavior of amplifiers above 127 with attributes.
  • Unstructured NBT data attached item stacks has been replaced with structured components.
  • Removed durability, potions, nbt, and enchantments fields in item predicates.
  • Recipe output can now specify components.
  • Int and float providers used in worldgen definitions are no longer wrapped in an extra value field next to type.
  • Added new item sub-predicates and loot functions.
481.211.21.1
  • Added data driven enchantments.
  • Added data driven paintings.
  • Renamed the enchantment field to enchantments in the item sub predicate.
  • Renamed legacy folders like loot_tables and tags/items to loot_table and tags/item and functions to function.
  • Removed the [NBT List / JSON Array] power fireball tag and replaced it with [Float] acceleration_power.
  • Attributes now have a single resource location id field instead of a name and uuid.
571.21.21.21.3
  • Removed attribute ID prefixes such as generic..
  • Changed formats of data components, loot tables and predicates.
  • Added new data components, loot tables and item tags.
  • Added key input predicate.
  • Added crafting_transmute recipe type.
  • Renamed enchantment effect damage_item to change_item_damage.
611.21.4
  • Renamed tnt minecart TNTFuse to fuse.
  • Renamed fields of furnace block entities.
  • Added required field duration to trail particle.
  • Changed format of the custom_model_data component and loot function.
711.21.5
  • Text components are now saved as objects in NBT rather than strings containing JSON and many commands such as /tellraw now take SNBT rather than JSON.
  • The Game Tests system is now accessible through data packs and for mods.
  • Added components blocks_attacks, break_sound, potion_duration_scale, provides_banner_patterns, provides_trim_material, tooltip_display, and weapon.
  • Added many entity variant components.
  • 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.
  • Many other changes have also been made. For all technical changes and additions, see Java Edition 1.21.5 § Technical.
801.21.6
  • 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.
  • /datapack now has a new argument: create.
  • Added /version.
  • Added [NBT Compound / JSON Object] display field to attribute_modifier item component entries.
  • Added camera_distance, waypoint_transmit_range, and waypoint_receive_range attributes.
  • painting/variant item component no longer accepts inline variants.
  • Added /dialog.
  • Added ui sound category.
811.21.71.21.8
  • Added music_disc_lava_chicken item and minecraft:music_disc.lava_chicken sound event

History

For pack format history, see  § Pack format.
Java Edition
1.1317w43aAdded data packs.
17w46aAdded /datapack, a command to control loaded data packs.
17w48aData packs can now load custom recipes.
Added the initial pack format version of 4.
17w49aTags can now be created with data packs.
17w49bTags can now be created for functions.
Functions tagged in minecraft:tick now run at the beginning of every tick.
18w01aFunctions tagged in minecraft:load now run once after a (re)load.
Crash reports now list what data packs are enabled.
1.1418w43aTags can now be created for entity types.
1.1519w38aAdded predicates.
1.1620w22aSlightly changed data pack loading to prevent custom data packs from crashing.
If data pack reload fails, changes are not applied and the game continues using previous data.
Changes to data pack list are stored only after successful reload.
If existing data packs prevent the world from loading, the game gives an option to load the world in safe mode, which loads only vanilla data pack.
Added --safeMode option for servers to load only with vanilla data pack.
Game now detects any critical data pack issues, such as required tags being missing, and prevent the world from being loaded.
Pre-release 1Data packs can now be loaded before the world is created.
Data packs can now add and change dimensions and dimension types.
1.16.220w27aData packs can now have a pack.png in the root folder, and display it in the data pack menu.
20w28aCustom worlds now support custom biomes and can now be used in custom dimension generators.
Data packs can now customize world generation in the worldgen folder.
1.1720w45aPack format in version.json has been split into data and resource versions.
20w46aAdded item modifiers.
1.18.2Pre-release 1It is now possible to add custom structures in experimental data packs: the game now generates and stores data-driven configured structures.
A lot of the cave generation is now configurable through data packs.
1.1922w11aData packs can now apply filters which block files from packs applied before the current pack.
1.19.322w42aAdded chat types.
Added a subsection called datapacks.
The Vanilla world generation data pack is now visible within the game's jar.
1.19.4
Experiment
Update 1.20
23w04aAdded trim_pattern and trim_material registries which is used to define armor trims.
1.19.423w06aAdded damage types.
1.2023w06aTrim patterns and trim materials definitions are no longer experimental.
1.20.223w31aData packs can now support multiple pack formats.
Data packs can now contain overlays which are applied over the "normal" contents of a pack.
1.20.524w10aAdded wolf variants which can be defined through data packs.
Data packs can now define custom banner patterns.
1.2124w18aData packs can now define custom painting variants.
Enchantments are now data-driven and can be defined through data packs.
Data packs can additionally define enchantment providers.
24w19aRenamed several directories:
  • tags/items -> tags/item
  • tags/blocks -> tags/block
  • tags/entity_types -> tags/entity_type
  • tags/fluids -> tags/fluid
  • tags/game_events -> tags/game_event
24w21aRenamed several directories:
  • structures -> structure
  • advancements -> advancement
  • recipes -> recipe
  • loot_tables -> loot_table
  • predicates -> predicate
  • item_modifiers ->item_modifier
  • functions -> function
  • tags/functions -> tags/function
Data packs can now define custom jukebox songs.
1.21.224w33aData packs can now define custom goat horn instruments.
24w35aTrial spawner configurations can now also be defined in datapacks, instead of only in the Trial spawner block entity.
1.21.525w03aAdded end-to-end GameTest system. Added test environment and test instance definitions to data packs.
Added pig variants; including definitions in data packs.
25w04aCat and Frog variants can now be defined in data packs.
25w05aAdded cow variants; including definitions in data packs.
25w06aAdded chicken variants; including definitions in data packs.
25w08aAddded wolf sound variants definition to data packs.
1.21.625w15aAdded /datapack create, that can create new empty directory data packs for current world.
25w20aData packs can now define custom dialogs.

Issues

Issues relating to "Data pack" are maintained on the bug tracker. Issues should be reported and viewed there.

Gallery

See also

External links

Navigation