-
Notifications
You must be signed in to change notification settings - Fork 7
Creating Datapacks
Open Loader will load data packs from the .minecraft/openloader/data/
folder. The mod can load data packs from folders or ZIP archives. Folders are recommended for mod packs as they are easier to test and debug. While ZIP archives can also be used they are generally reserved for preexisting data packs. The Open Loader folder can be included in modpacks by including the openloader folder in your pack export.
To learn more about the types of content you can create using data packs refer to the vanilla wiki. Modded data pack content can often be found on their wiki pages.
To create a new folder pack make a folder in the data directory. This folder should be unique to your project and avoid upper case and special characters. Inside this folder you will need a pack.mcmeta
file. This is just a text file and it tells the game about your data pack.
Example pack.mcmeta
{
"pack": {
"pack_format": 6,
"description": "The description of your data pack."
}
}
Your folder should now be loaded as a data pack. You can now add data to the folder and it will be loaded into the game. You can test this by adding some data and running the /reload
command.
A new crafting recipe can be added by creating a JSON file in the correct folder. Minecraft loads crafting recipes from the data/packid/recipes/
folder within your data pack folder. So the full folder path would be .minecraft/openloader/data/packid/data/packid/recipes/
.
Example recipe: dirt_to_diamond.json
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:dirt"
}
],
"result": {
"item": "minecraft:diamond",
"count": 9
}
}
The internal IDs for data pack defined content comes from the name of the files and folders you use. This is why it is important for all folders and file names to be lower case and avoid most special case characters like spaces. File extensions are also generally ignored. For example the file data/example/recipes/dirt_to_diamonds.json
would be given the ID example:dirt_to_diamonds
. Recipes can be loaded from sub folders however these folders will be added to the ID of the content. For example data/example/recipes/overpowered/dirt_to_diamonds
will become example:overpowered/dirt_to_diamonds