← All articles

Data packs vs commands: how to actually install one

Almost every builder on this site hands you a command you paste into chat. Loot tables, recipes and advancements do not work that way, and there is no command that will make them. They are files. This is the page that explains the difference, because it is the thing that trips people up before anything else does.

Open the data pack generator

There is no /loottable command

If you have used the item builder or the potion builder here, the routine is familiar: fill in a form, copy a /give line, paste it into chat, done. That works because an item is a thing the game can hand you on the spot.

A loot table is not a thing you hold. It is a rule: "when this chest generates, roll these odds." A recipe is a rule about the crafting grid. An advancement is a rule about when something counts as achieved. Rules have to exist before the moment they apply, so the game reads them at load time from files on disk. There is no /loottable, no /recipe add, and no chat command that creates any of them, because by the time you could type it, the moment it governs has already passed.

That is the whole distinction:

CommandsData packs
DeliveryPaste into chat or a command blockFiles in a folder the world loads
Good forOne-off actions: give an item, set a bossbar, send a messageStanding rules: loot, recipes, advancements, reusable functions
Takes effectImmediatelyOn world load or /reload
Survives restartOnly its effectsYes, the rule itself persists

What a data pack actually is

A folder with a pack.mcmeta file at the top and a data directory underneath. That is the entire requirement. Minecraft accepts it zipped or unzipped, and it goes here:

.minecraft/saves/<world>/datapacks/<your-pack>/
  pack.mcmeta
  data/
    harbor/
      function/
        load.mcfunction
      loot_table/
        example_chest.json
    minecraft/
      tags/function/
        load.json

Two namespaces appear there and they do different jobs. harbor is yours — it keeps your files from colliding with vanilla or with another pack, and it becomes part of every ID you reference, like harbor:load. The minecraft namespace is used only to hook into things vanilla already defines, which is why the load tag lives there and not in yours.

The 1.21 rename that silently breaks packs

This one deserves its own section because of how it fails. In 1.21, Mojang renamed every content directory from plural to singular:

The failure mode is nasty: a pack using the old plural names on 1.21+ still loads. /datapack list shows it as enabled. There is no error. The game simply never looks in those folders, so nothing you wrote ever runs. People lose evenings to this, usually while following a tutorial written before 1.21.

If your pack is enabled and doing nothing at all, check the folder names first, before you start debugging the JSON inside them.

pack_format is a version lock, not a version number

The number in pack.mcmeta tells Minecraft which data format your files are written in. Get it wrong and the pack is flagged as incompatible.

{
  "pack": {
    "pack_format": 61,
    "description": "Harbor district rules"
  }
}
Minecraft versionData pack format
1.20 – 1.20.115
1.20.218
1.20.3 – 1.20.426
1.20.5 – 1.20.641
1.21 – 1.21.148
1.21.2 – 1.21.357
1.21.461
1.21.571
1.21.680
1.21.7 – 1.21.881

Note that these are data pack numbers. Resource packs use a separate scale, so a pack_format you copied from a resource pack tutorial will be wrong here.

load and tick

Two function hooks cover most of what a pack needs to do on its own. You write a .mcfunction file — a plain text file, one command per line, no leading slash — and then point a tag at it.

load runs once when the pack loads and again on every /reload. It is where you set up scoreboards, constants and starting state. tick runs twenty times a second, forever, for as long as the pack is enabled. It is powerful and it is the easiest way to wreck your server's performance, so only reach for it when something genuinely has to be checked continuously.

The tag file is what actually connects them:

// data/minecraft/tags/function/load.json
{
  "values": ["harbor:load"]
}

Without that tag the function still exists and can be called manually with /function harbor:load, but nothing will run it for you.

Installing and checking it worked

  1. Put the pack folder or ZIP in <world>/datapacks/. On a server that folder sits next to level.dat.
  2. Run /reload in game. You do not need to restart.
  3. Run /datapack list. Your pack should appear in the enabled list.

If it is missing from that list, the problem is structural: a wrong pack_format, a malformed pack.mcmeta, or an extra folder level because the ZIP was made from the parent directory instead of from the pack's own contents. That last one is common — pack.mcmeta has to be at the top of the archive, not inside another folder.

If it is listed but nothing happens, the structure is fine and the problem is inside: plural folder names on 1.21+, a namespace typo in a tag, or JSON that is valid text but not a shape the game expects.

Where to go next

The data pack generator builds this whole skeleton for you and switches folder names and pack_format automatically when you pick a version, which removes the two most common ways to get it wrong. From there, the resource pack structure reference covers the other half of the ecosystem — the part that changes how the game looks rather than how it behaves.