Minecraft:Data pack
More actions
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
Template:Exclusive Template:Relevant tutorial
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 [[Minecraft:wikipedia:Zip (file format)|Template:Code file]] containing a Template:Cd file. Data packs are used to define among others advancements, dimensions, Minecraft:enchantments, Minecraft:loot tables, recipes, structures, and Minecraft:biomes (see Template:Slink for a full list). The definitions of the vanilla features is done using a built-in data pack. Minecraft: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.
Usage
Data packs can be added to a world during world creation in the Minecraft: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 Template:Code folder of a world.
When adding or modifying a data pack while the world is loaded, changes done to registry tags, Minecraft:loot tables, Minecraft:recipes, Minecraft:advancements, Minecraft:item modifiers, Minecraft:predicates, functions, and structure templates can be loaded using the Template:Cmd command. Other features require the world or server to be rebooted for changes to take effect (see Template:Slink).
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 Template:Cmd command. The loading order of data packs is stored in the [[Minecraft:Java Edition level format#level.dat_format|Template:Cd 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, Minecraft:tag files without Template:Cd 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.
Experimental Settings
Template:Not to be confused with
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 Minecraft:singleplayer will display a warning screen to the player. Additionally, worlds using experimental settings cannot be played on Minecraft: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 Template:Cmd 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 Template:Slink 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 Template:Cd file containing meta-data about the data pack. The data is organized into Minecraft:namespaces to avoid files from different packs unintentionally interfering with each other. Files are loaded as follows:
- The file Template:Cd is loaded into the Template:Cd registry with ID Template:Cd. Both Template:Cd and Template:Cd can contain slashes (Template:Cd), which results in extra sub-folders.
- Functions use the Template:Cd extension
- Minecraft:Structure files use the Template:Cd extension
- Minecraft:Tags are loaded from files Template:Cd which results in a Template:Cd tag named Template:Cd.
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.
- Template:File/Template:File
- Template:File: Metadata of the data pack. This is the only mandatory file.
- Template:File: The picture to display next to the data pack in the "Data Pack Selection" screen.
- Template:File
- Template:File: Folder of the namespace to use, see Template:Slink. More than one directory for different namespaces may exist under the Template:Cd directory. The Template:Cd namespace is used for vanilla files and can be used to override them.
- Template:File: Template:Cd files with lists of commands.
- Template:File: Template:Cd files defining a saved structure of blocks.
- Template:File: Collections of things. Each sub-folder defines tags of a specific type using Template:Cd files.
- Template:File: Tags of functions.
- Template:File: Tags can be defined for any registry, see Template:Slink for tag types used.
- All following folders contain Template:Cd files defining the content:
- Template:File: Definitions of Minecraft:advancements.
- Template:File*: Textures and names to use for banner patterns.
- Template:File*: Textures and spawn conditions of cat variants.
- Template:File*: Formatting of Minecraft:chat messages.
- Template:File*: Textures and spawn conditions of chicken variants.
- Template:File*: Textures and spawn conditions of cow variants.
- Template:File*: Attributes of damage and death messages.
- Template:File*: Definitions of dialogs.
- Template:File*: Biome layout and terrain of dimensions.
- Template:File*: Properties of dimensions.
- Template:File*: Enchantment effects, supported items, level cost, etc.
- Template:File*: Selection of enchantments for specific uses.
- Template:File*: Textures and spawn conditions of frog variants.
- Template:File*: Instruments for goat horns.
- Template:File: Loot functions used to modify items.
- Template:File*: Jukebox song definitions.
- Template:File: Loot from mobs, blocks, chests, etc.
- Template:File*: Size and texture of paintings.
- Template:File*: Textures and spawn conditions of pig variants.
- Template:File: Tests for specific conditions based on position, mobs, etc.
- Template:File: Recipes for Minecraft:crafting, Minecraft:smelting, etc.
- Template:File*: A way to group up Minecraft:GameTests and give them the right preconditions to run.
- Template:File*: A test that can be run by the Minecraft:GameTest framework.
- Template:File*: A timeline which specifies events and attributes according to the time of day.
- Template:File*: A set of trades selected by Minecraft:villagers and Minecraft:wandering traders.
- Template:File*: Configuration of Minecraft:trial spawners.
- Template:File*: Colors, ingredients, and name of materials for Minecraft:trimming
- Template:File*: Textures and name of patterns for Minecraft:trimming
- Template:File*: Trades of Minecraft:villagers and Minecraft:wandering traders
- Template:File*: Sound variants of wolfs.
- Template:File*: Textures and spawn conditions of wolf variants.
- Template:File*: Clocks used to keep track of internal time.
- Template:File*
- Template:File: Biome generation options, effects, etc.
- Template:File: Carver cave definitions
- Template:File: Configuration of Minecraft:features.
- Template:File: Mathematical operations to calculate values for each position in the world.
- Template:File: Size and amplitudes of a noise.
- Template:File: Terrain shape including noise caves, and main terrain block types.
- Template:File: Placement of features within a chunk.
- Template:File: Post-processing of blocks in structures.
- Template:File: Definition of structure generation and allowed biomes.
- Template:File: Distribution of a set of structures within the world.
- Template:File: A set of templates (structure files) for use in Minecraft:jigsaw structures.
- Template:File: Sets of dimensions selectable in the Create World screen.
- Template:File: Presets selectable for the "Superflat" world type.
- Template:File: Name of a preset to use for the multi noise biome layout.
- Template:File*: Textures and spawn conditions of zombie nautilus variants.
- Template:File: Folder of the namespace to use, see Template:Slink. More than one directory for different namespaces may exist under the Template:Cd directory. The Template:Cd namespace is used for vanilla files and can be used to override them.
Template:Mono
Template:Main A data pack is identified by Minecraft based on the presence of the Template:Code file in the root directory of the data pack, which contains data in JSON format.
A Template:Code file to produce a data pack that looks like the "vanilla" data pack in 1.21.9 would look like this: Template:Filename Template:Pack.mcmeta
Pack format
History
Issues
Gallery
-
Example of a custom world created with a data pack.
See also
External links
- misode.github.io provides data pack generators
Template:Navbox Java Edition Template:Navbox Java Edition technical
Minecraft:de:Datenpaket Minecraft:es:Paquete de datos Minecraft:fr:Pack de données Minecraft:ja:データパック Minecraft:ko:데이터 팩 Minecraft:pl:Paczki danych Minecraft:pt:Pacote de dados Minecraft:ru:Набор данных Minecraft:th:ดาต้าแพ็ก Minecraft:zh:数据包