2

How do you make a data pack?

Diamondpuppy808 10/2/18 6:51 pm
5.6k
10/3/2018 5:48 pm
I've always wanted to make a data pack... but I never how to do the coding, so does anyone know of any blogs or something that shows you how?
Posted by
Diamondpuppy808
Level 20 : Expert Taco
4

  Have something to say?

JoinSign in

5

ShelLuser
10/03/2018 12:11 am
Level 61 : High Grandmaster System
history
As mentioned below the Minecraft wiki is usually the best place to go to. This page explains the whole concept of datapacks. In short a datapack is basically a placeholder for your collection of Minecraft customizations. Stuff like recipes, loot tables, advancements and functions.

Making one is actually quite easy but not very well explained on that page I think. Basically it boils down to this:
  • In the world list ('singleplayer') click on the world for which you want to create the datapack, then click edit (in bottom left corner).

  • Click the option 'Open world folder', your default file manager opens and you'll be taken to the world itself. Now you should also see the 'datapacks' folder, open it.

  • Create a folder using the same name as you'd want to use for your datapack. It won't be used anywhere else but your datapack (basically you'd only see it when using /datapack list).

  • Create a text file called "pack.mcmeta" according to the data shown on the wiki page.

Basically this is what a regular pack file could look like:


{
"pack":{
"pack_format": 1,
"description": "Experiments for the Redstone world."
}
}

  • Create the 'data' folder and then create a namespace folder.

  • For the best results you should now create the full folder structure as shown on the wiki page I linked to before (so: advancements, loot_tables, recipes, structures and tags (don't forget the sub folders in this folder as well)). It won't make a big difference but whenever you want to add something to your datapack you'll now have the location for it already available.

A namespace is basically what the main name in your stuff should be. For example: /function catslair:tools/shell. This shows you that my function is called shell, sits in the 'tools' folder and is defined within the 'catslair' namespace. So somewhere in my datapack folder I have this setup: data\catslair\functions\tools\shell.mcfunction.

Using a 'minecraft' namespace only makes sense if you plan on overriding stuff like recipes or loot tables though it's most commonly used to set up specific function tags.

And that's basically it. Now you can add functions, structures, and other stuff. Don't forget to use /reload after you did so while the game was still running.
5
Diamondpuppy808
10/03/2018 5:48 pm
Level 20 : Expert Taco
THX! :D
1
DukkiStuff
10/02/2018 7:36 pm
Level 9 : Apprentice Birb
Get SKIIIILLLSLSLLSLS

nah jk, what eatYourHashs said, go to the minecraft wiki
1
Hashs
10/02/2018 7:00 pm
Any/All • Level 68 : High Grandmaster Botanist Procrastinator
Minecraft wiki has a guide on creating a data pack. You may want to check that out.
2
Diamondpuppy808
10/03/2018 5:48 pm
Level 20 : Expert Taco
TY! :D
1

Welcome