# Datapack

A datapack is a folder (or Zip archive) containing Json files that will be parsed by Minecraft and mods to configure various gameplay elements (recipes, tags, advancements, worldgen etc...)

This wiki covers only the basics, that you need to make custom machines and recipes, for more detailed information about datapacks see [the vanilla wiki](https://minecraft.fandom.com/wiki/Data_pack).

### How to make a datapack

1. Create a new folder, name it as you want, there are no restrictions on the name of that folder.
2. Inside that folder create a new folder named `data`&#x20;
3. Next to the `data` folder create a new text file named exactly `pack.mcmeta` (the .mcmeta is the file extension, be sure that your file isn't named `pack.mcmeta.txt`
4. Open the `pack.mcmeta` file with the text editor of your choice and paste the following :&#x20;

```json
{
    "pack": {
        "pack_format": 9,
        "description": "A description for my datapack"
    }
}
```

That's it, your folder is now a datapack.

### How to load your datapack

#### The vanilla way

{% hint style="warning" %}
This method won't work if you want to publish your modpack on Curseforge, as it require the world to be generated first.
{% endhint %}

In vanilla datapacks must be placed in the `datapacks` folder, which can be found in the `world` folder.

* Singleplayer : `<instance>/saves/<save_name>/datapacks/<datapack_folder>`
* Server : `<instance>/<world_name>/datapacks/<datapack_folder>`&#x20;

{% hint style="info" %}
If you're playing on a server you don't need to install datapacks in your game (they will be ignored anyway).

The datapacks installed on the server are synched automatically when you connect.
{% endhint %}

#### Using Open Loader

1. Install [Open Loader](https://www.curseforge.com/minecraft/mc-mods/open-loader) like any other mods.
2. Place your datapack folder here : `<instance>/config/openloader/data/<datapack_folder>`

#### Using KubeJS

If you already have [KubeJS](https://www.curseforge.com/minecraft/mc-mods/kubejs) installed (don't install it only for loading datapacks).

The `<instance>/kubejs/data` folder is already a datapack, any json files here will be loaded as they would be in a datapack.

You don't need any `pack.mcmeta` file.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
