Data Pack

From Minecraft Wiki
(Redirected from Data pack)
Jump to navigation Jump to search

A Data Pack is a folder that can be added to saved games. The data pack system allows for custom Functions, tags, Advancements, recipes, structures, and loot tables to be added without modifying the game. They were first introduced in Java Edition 1.13 snapshot 17w43a.

Usage[edit | edit source]

Data packs are placed in the .minecraft/saves/(world name)/datapacks folder of a world, with each pack either being a sub-folder or a .zip file within the datapacks folder. Once a data pack is in the folder, it will be enabled for that world when it's reloaded or loaded.

Data packs load their information based on a certain order. The order can be seen and changed via the /datapack command, and is saved in the level.dat file.

If functions are tagged under #minecraft:tick, then they will be run once per tick. If they are tagged under #minecraft:load, then they will be run every time the data pack is reloaded or loaded.

Layout[edit | edit source]

Data pack name: the name of the data pack.

  • pack.mcmeta: a JSON file that defines the in-game description and version of the pack.
  • pack.png: a PNG image icon that will show up beside the data pack name in the data pack list.
  • data: a folder.
    • Namespace: a folder containing components. The name of this folder is referenced when calling a component.
      • functions: the folder containing all the functions within a namespace.
      • loot tables:the folder containing all the loot tables within a namespace.
      • advancements: the folder containing all the loot tables within a namespace.
      • recipes: the folder containing all the recipes within a namespace.
      • structures: the folder containing all the structures within a namespace.
      • tags: the folder containing all the tags within a namespace.
        • blocks: the folder contain all the block tags.
        • items: the folder contain all the block tags.
        • functions: the folder contain all the block tags.
        • entity_types: the folder contain all the block tags.
        • fluids: the folder contain all the block tags.

In the top folder, and each final folder, as many files and folders can be added as the player desires. However, the game will only use the files if:

  • They have the right extension: structures use .nbt, functions use .mcfunction, and all other components use .json.
  • They are stored under the appropriate folder.
  • They are free of syntactical errors (for functions, this can be troubleshooted by trying to run each individual command in the erring function in-game).

See also[edit | edit source]