Data pack

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.- Functions use the
.mcfunction
extension - Structure files use the
.nbt
extension
- Functions use the
- 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]
/
<data pack name>
pack.mcmeta: Metadata of the data pack. This is the only mandatory file.
pack.png: The picture to display next to the data pack in the "Data Pack Selection" screen.
data
<namespace>: Folder of the namespace to use, see Resource location § Namespaces. More than one directory for different namespaces may exist under the
data
directory. Theminecraft
namespace is used for vanilla files and can be used to override them.function:
.mcfunction
files with lists of commands.structure:
.nbt
files defining a saved structure of blocks.tags: Collections of things. Each sub-folder defines tags of a specific type using
.json
files.function: Tags of functions.
<registry name>: Tags can be defined for any registry, see Tag § List of tags for tag types used.
- All following folders contain
.json
files defining the content:
advancement: Definitions of advancements.
banner_pattern: Textures and names to use for banner patterns.
cat_variant: Textures and spawn conditions of cat variants.
chat_type: Formatting of chat messages.
cow_variant: Textures and spawn conditions of cow variants.
damage_type: Attributes of damage and death messages.
dimension: Biome layout and terrain of dimensions.
dimension_type: Properties of dimensions.
enchantment: Enchantment effects, supported items, level cost, etc.
enchantment_provider: Selection of enchantments for specific uses.
frog_variant: Textures and spawn conditions of frog variants.
instrument: Instruments for goat horns.
item_modifier: Loot functions used to modify items.
jukebox_song: Jukebox song definitions.
loot_table: Loot from mobs, blocks, chests, etc.
painting_variant: Size and texture of paintings.
pig_variant: Textures and spawn conditions of pig variants.
predicate: Tests for specific conditions based on position, mobs, etc.
recipe: Recipes for crafting, smelting, etc.
test_environment: A way to group up GameTests and give them the right preconditions to run.
test_instance: A test that can be run by the GameTest framework.
trial_spawner: Configuration of trial spawners.
trim_material: Colors, ingredients, and name of materials for trimming
trim_pattern: Textures and name of patterns for trimming
wolf_variant: Textures and spawn conditions of wolf variants.
worldgen
biome: Biome generation options, effects, etc.
configured_carver: Carver cave definitions
configured_feature: Configuration of features.
density_function: Mathematical operations to calculate values for each position in the world.
noise: Size and amplitudes of a noise.
noise_settings: Terrain shape including noise caves, and main terrain block types.
placed_feature: Placement of features within a chunk.
processor_list: Post-processing of blocks in structures.
structure: Definition of structure generation and allowed biomes.
structure_set: Distribution of a set of structures within the world.
template_pool: A set of templates (structure files) for use in jigsaw structures.
world_preset: Sets of dimensions selectable in the Create World screen.
flat_level_generator_preset: Presets selectable for the "Superflat" world type.
multi_noise_biome_source_parameter_list: Name of a preset to use for the multi noise biome layout.
pack.mcmeta[edit | edit source]
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": {
"description": "The default data for Minecraft",
"pack_format": 61
}
}
Pack format[edit | edit source]
Value | Releases | [hide]Significant/Breaking Changes | |
---|---|---|---|
From | To | ||
4 | 1.14.4 | Added the initial pack format version of 4. | |
5 | 1.16.1 | Added predicates. | |
6 | 1.16.5 | Added experimental support for custom world generation. | |
7 | 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 | 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 | 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.3 | Data packs can now have a [NBT Compound / JSON Object] filter section in pack.mcmeta . Merged /locatebiome with /locate , changing its syntax. | |
12 | 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 | 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 | Added function macros. Effects now use namespaced IDs rather than numeric values in NBT. E.g. 1 is now minecraft:speed . | ||
26 | 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.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 | 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.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 | 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 | 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]
[hide]Java Edition | |||||||
---|---|---|---|---|---|---|---|
1.13 | 17w43a | Added data packs. | |||||
17w46a | Added /datapack , a command to control loaded data packs. | ||||||
17w48a | Data packs can now load custom recipes. | ||||||
Added the initial pack format version of 4 . | |||||||
17w49a | Tags can now be created with data packs. | ||||||
17w49b | Tags can now be created for functions. | ||||||
Functions tagged in minecraft:tick now run at the beginning of every tick. | |||||||
18w01a | Functions tagged in minecraft:load now run once after a (re)load.
| ||||||
Crash reports now list what data packs are enabled. | |||||||
1.14 | 18w43a | Tags can now be created for entity types. | |||||
1.15 | 19w38a | Added predicates. | |||||
1.16 | 20w22a | Slightly 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 1 | Data packs can now be loaded before the world is created. | ||||||
Data packs can now add and change dimensions and dimension types. | |||||||
1.16.2 | 20w27a | Data packs can now have a pack.png in the root folder, and display it in the data pack menu. | |||||
20w28a | Custom 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.17 | 20w45a | Pack format in version.json has been split into data and resource versions. | |||||
20w46a | Added item modifiers. | ||||||
1.18.2 | Pre-release 1 | It 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.19 | 22w11a | Data packs can now apply filters which block files from packs applied before the current pack. | |||||
1.19.3 | 22w42a | Added chat types. | |||||
Added a subsection called datapacks .
| |||||||
The Vanilla world generation data pack is now visible within the game's jar. | |||||||
1.19.4 | 23w06a | Added damage types. | |||||
1.20.2 | 23w31a | Data 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.5 | 24w10a | Added wolf variants which can be defined through data packs. | |||||
Data packs can now define custom banner patterns. | |||||||
1.21 | 24w18a | Data 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. | |||||||
24w19a | Renamed several directories:
| ||||||
24w21a | Renamed several directories:
| ||||||
Data packs can now define custom jukebox songs. | |||||||
1.21.2 | 24w33a | Data 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]
-
Example of a custom world created with a data pack.
See also[edit | edit source]
- Add-on
- Tutorials/Installing a data pack
- Tutorials/Creating a data pack
- Resource Pack
- Tutorials/Creating a resource pack
External links[edit | edit source]
- misode.github.io provides data pack generators
[edit | edit source]
[hide] | |||
---|---|---|---|
Versions | |||
Development |
| ||
Technical | |||
Game customization |
[hide] | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
|