DGuard

Data packs on a Minecraft server: install, commands, safety

A data pack changes the game without a line of Java: it adds recipes, advancements, loot tables, structures and even new world generation. It works on a vanilla server and on Paper alike. Here's where it goes, how to enable and reload it, what the numbers in pack.mcmeta mean, and how a data pack differs from a plugin.

The DGuard team7 min read

In short: put the .zip or folder with a pack.mcmeta file into world/datapacks and run minecraft:reload from the console — or restart the server. Check with datapack list enabled: the pack shows up as [file/name]. Packs that change world generation, dimensions or enchantments only apply after a restart, and world generation goes in before the world is created.

What a data pack is and how it differs from a plugin

A data pack is a folder or .zip archive with a pack.mcmeta file at its root and a data folder. Inside are JSON definitions, .mcfunction functions (lists of commands) and .nbt structures. The game itself keeps vanilla recipes, loot and generation in a built-in vanilla data pack, which is why another pack can add to them or replace them.

Data packPlugin
What's insideJSON, command functions, structuresJava code
Where it runsAny Java server, vanilla included, and singleplayerPaper, Spigot and their forks
How it changes the gameThrough game data and commandsThrough the server API: any logic, databases, networking
Where it goesworld/datapacksplugins/ — see how to install a plugin

What a data pack can do: recipes, advancements, loot tables, predicates, tags, functions, structures, world generation, dimensions, enchantments, mob variants, dialogs. What needs a plugin: custom commands with permissions, economy, land claims, databases, and anything that has to work on a player's network packets.

How to install a data pack on a server

  1. 1

    Download a pack for your version

    It's a .zip or a folder. Make sure pack.mcmeta sits at the root of the archive, not inside a nested folder — otherwise the game won't see the pack.

  2. 2

    Put it in the world folder

    Into datapacks inside the world folder: world/datapacks by default (the world name comes from level-name in server.properties). Create the folder if it isn't there.

  3. 3

    Reload or restart

    Recipes, loot, advancements and functions are picked up by minecraft:reload. World generation, dimensions, enchantments and the other "experimental" parts need a restart.

  4. 4

    Check

    Run datapack list enabled in the console. If the pack isn't listed, look for the error in logs/latest.log — see logs and crashes.

If a pack has an error, such as a broken recipe format, minecraft:reload doesn't apply the changes and the game keeps running on the previous data. The datapack enable and datapack disable commands reload packs too.

The /datapack command

CommandWhat it does
datapack list [available|enabled]All packs, only available ones or only enabled ones
datapack enable <name>Enable a pack
datapack enable <name> first|lastEnable it with the lowest or highest priority
datapack enable <name> before|after <other>Enable it before or after another pack
datapack disable <name>Disable a pack. The file stays in the folder
datapack create <id> <description>Create an empty folder pack for the current world (since 1.21.6, operator level 4)
Operator level 2, except create. A pack from the folder is named file/name

Order matters: when the same file exists in several packs, the one loaded last wins, while tags without "replace": true merge. The order is stored in the world's level.dat. Packs that need an experimental feature flag can only be enabled when the world is created — the command can't turn them on later.

Packs at world creation: server.properties

Two server.properties keys only act when a new world is created — they don't touch an existing one:

KeyDefaultWhat it does
initial-enabled-packsvanillaPacks to enable on world creation, comma-separated. Experimental packs must be listed explicitly
initial-disabled-packsemptyPacks not to enable automatically, comma-separated

A world generation pack only affects new chunks; chunks that already exist stay as they are. So install it before the first start or before pregenerating the world, not on a lived-in server.

pack.mcmeta and the format number

pack.mcmeta tells the game which versions a pack was made for. Since 1.21.9 a single pack_format gave way to a min_format and max_format range; the old field is only needed if the pack also supports versions from before this scheme.

a data pack's pack.mcmeta for 1.21.11
{
  "pack": {
    "description": "Server recipes",
    "min_format": 94,
    "max_format": 94
  }
}
VersionData packResource pack
1.21.46146
1.21.7–1.21.88164
1.21.1194.175.0
26.1–26.1.2101.184.0
26.2107.188.0
26.3121.097.1
Format numbers from the Minecraft Wiki. A pack with a newer format than the game's is marked incompatible

Safety: trusted sources only

  • A pack's functions are server commands. They run at the permission level from function-permission-level (2 by default) — the level that allows, for example, /gamerule, /worldborder and /datapack. A pack from a shady source can quietly change your world.
  • Look inside. A data pack is plain text files: before installing, open the function folder and check which commands run, especially in functions tagged minecraft:load (on load) and minecraft:tick (every tick).
  • Every-tick functions cost TPS. A heavy function in minecraft:tick loads the server constantly — measure it with a profiler: see spark.
  • Back up first. A generation or dimension pack changes the world for good — make a backup.
  • If the world won't load. Paper can start worlds with only the built-in vanilla pack via the --safeMode launch argument. That lets you remove a broken pack.

Data packs and the anticheat

A data pack sees the game through data and commands, not through the client's network packets. So packet-level checks — Timer, Blink, BadPackets — can't be built from functions: an anticheat is a plugin. DGuard — the best anticheat for a modern Minecraft server — runs on Paper and Leaf 1.21–26.3 next to PacketEvents and catches cheats in combat, movement, packets, inventory, building and the world.

If a data pack changes speed, knockback or attack reach — with custom enchantments, say — check the punishment log after installing it to see whether honest players started showing up. DGuard gathers evidence without rushing to a verdict, and you set how strict it is. How to sort out disputed cases — in false bans.

FAQ

Where do data packs go on a server?

Into the datapacks folder inside the world folder — world/datapacks by default. Not into plugins/: it's not a plugin.

Why isn't my data pack working?

Usually pack.mcmeta isn't at the archive root, the pack was made for another version, or it has an error — logs/latest.log will show it. Check datapack list enabled; world generation and dimensions need a restart.

How do I reload data packs on Paper?

With minecraft:reload. A plain /reload on Paper reloads Bukkit plugins, which Paper advises against.

Data pack or plugin — which should I use?

Recipes, loot, advancements and world generation are fine as a data pack, which also runs on a vanilla server. Commands with permissions, economy, land claims and cheat protection need a plugin.

Sources

All sections

Run the best anticheat for modern Minecraft

DGuard catches all 47 kinds of cheats in our comparison — the closest rival, Intave, has 27. Full protection on every plan, free up to 30 players online.