Skip to content

Craft a datapack
New

Craft datapacks
  1. Create a new folder with the name of your datapack and open it in your editor

  2. In the root folder of your datapack create a

    The pack.mcmeta describes information about your datapack

    // pack.mcmeta
    {
    "pack": {
    "description": "This is the description of your datapack",
    "pack_format": 8,
    "supported_formats": [8, 9]
    }
    }

    The description field can use Formatting codes.

    The pack_format field is the version of the datapack format. This field is related to the Minecraft Version you want your datapack to be compatible with. Check out which Datapack versions you should set.

    New Minecraft Versions may introduce new features to datapacks by bumping the Datapack version.

    Starting from 1.20.2, if your datapack uses functionalities that haven’t been changed in the version bump, it’s possible to set the supported_formats field to make your datapack compatible with new Minecraft Versions without changing the code nor the pack_format field. Set the first number of the supported_formats field to the lowest Datapack version you support, and the second number to the highest Datapack version you support.

    If your datapack uses functionalities that may have been affected by the version bump, you have to bump you pack_format field and also update the code according to the chages made.

    The pack.png is the icon that will be displayed in the datapack selection menu. It’s optional and it has to be a square

  3. Create a data folder

    This folder will contain all the code of your datapack organized in namespaces

    For example, if you want to change some Minecraft features, create a minecraft folder, and the code in this folder will overwrite the corrisponding file inside of Minecraft Vanilla.

    If you want to add new features, create a new folder, and the files in this folder will be added to the base game.

    So far your datapack should look something like this:

    • Directory<datapack>
      • pack.mcmeta
      • pack.png
      • Directorydata
        • Directoryminecraft
        • Directory<namespace>
        • Directory<namespace2>
  4. Add features to your datapack (view all)

  5. Done

Here’s some code examples of datapacks I’ve made:

Since Datapacks are static files, they can also be generated with online tools like Crafting or Misode.

Keep in mind that sometimes these generators won’t have the latest version right away or a niche snapshot, since the datapack syntax can change a lot with new Versions.

When aiming for a more complex datapack, maybe a hybrid or complete manual approach is better.