Datapacks allow map makers and server admins to customize Minecraft mechanics without installing heavy server mods or forge launchers. You can add custom recipes, loot tables, functions, and custom achievement popups!
Datapack Folder Structure
my_custom_pack/
├── pack.mcmeta
└── data/
└── my_namespace/
├── advancements/
│ └── slay_dragon.json
└── functions/
└── reward.mcfunction
Defining the pack.mcmeta File
In 1.21, the pack format for datapacks updated. Ensure your pack.mcmeta specifies format 65+ (Minecraft 26.x) for Minecraft 26.x compatibility. Generate valid mcmeta files instantly with our pack.mcmeta Generator.
Advancement Triggers
Advancements trigger on specific player actions, such as minecraft:player_killed_entity, minecraft:inventory_changed, or minecraft:location. You can attach a function reward to grant items or play sounds when unlocked.
Build custom JSON advancement trees with custom icons using our Advancement Generator!
Create a minimal advancement datapack
- Create a datapack folder with a valid
pack.mcmetafor the exact Java version. - Add the advancement JSON under the version-correct
data/<namespace>/advancement/path. - Give the advancement a unique namespaced ID and at least one criterion.
- Place the pack in the world's
datapacksfolder and run/reload. - Use
/advancement grant @s only namespace:idto verify the file loads.
Debug a file that does not appear
Read the game log immediately after /reload. A missing comma, wrong directory name, invalid trigger or obsolete pack format normally produces a useful parsing message. Confirm the namespace and file path are lowercase and that the command uses the same ID.
Start with one criterion and no display section. Once the grant command works, add title, description, icon, parent and rewards incrementally. This makes it clear which addition caused a failure.
