Data pack

(Redirected from Datapack)
Jump to navigation Jump to search
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[edit | edit source]

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 a data pack while the world is loaded, registry tags, loot tables, recipes, advancements, item modifiers, predicates, functions, and structure templates can be loaded using the /reload command. The remaining features require closing and reloading the world (or restarting a server) to become active or modified, and are considered "experimental".

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.

Contents[edit | edit source]

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>.

Directory structure[edit | edit source]

pack.mcmeta[edit | edit source]

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.

pack.mcmeta, as used by the "vanilla" data pack in 1.21.4, as found in the client and official server jars:

pack.mcmeta

{
    "pack": {
        "description": "The default data for Minecraft",
        "pack_format": 61
    }
}

Pack format[edit | edit source]

For the full list of pack formats in all versions, see Pack format § List of data pack formats.


Data pack formats
Value Releases [hide]Significant/Breaking Changes
From To
4

1.13

1.14.4 Added the initial pack format version of 4.
5

1.15

1.16.1 Added predicates.
6

1.16.2

1.16.5 Added experimental support for custom world generation.
7

1.17

1.17.1 The /replaceitem command was replaced with /item. The set_damage loot function now require a valid [String] type field.
8

1.18

1.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.
9

1.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.
10

1.19

1.19.3 Data packs can now have a [NBT Compound / JSON Object] filter section in pack.mcmeta. Merged /locatebiome with /locate, changing its syntax.
12

1.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.
15

1.20

1.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.
18

1.20.2

Added function macros. Effects now use namespaced IDs rather than numeric values in NBT. E.g. 1 is now minecraft:speed.
26

1.20.3

1.20.4 Text components are parsed more strictly. Renamed grass block and item to short_grass. Added scoreboard display names and number formats.
41

1.20.5

1.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.
48

1.21

1.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. 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.
57

1.21.2

1.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.
61

1.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.
71

1.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 many new components. Added 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. 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.

History[edit | edit source]

For pack format history, see  § Pack format.
[hide]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.423w06aAdded damage types.
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.

Issues[edit | edit source]

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

Gallery[edit | edit source]

See also[edit | edit source]

External links[edit | edit source]

Navigation[edit | edit source]