Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Chapter 7 — How Minecraft Really Works

What You’ll Understand

Chapter 6 left you at a wall. You can type commands, aim them, and even bottle them into command blocks, but those blocks stay buried in the world, can’t be handed to a friend as a download, and fall apart once a project needs hundreds of them. The question you walked away with was simple: how do I make the commands I’ve been typing permanent and shareable? This chapter answers it, but not with a button or a block. It answers it with an idea, the one the rest of this book rests on: Minecraft builds its world by reading data files, and a data pack is how you hand it your own.

You won’t build anything in this chapter, and you won’t even open a single file yet. Once this idea clicks, though, everything ahead (recipes, custom items, new enchantments, whole dimensions) stops feeling like magic and starts feeling like filling in forms the game already knows how to read. By the end you’ll be able to explain, in your own words, what people mean when they call Minecraft “data-driven,” what a registry is, why folks say “vanilla is just a data pack,” and why this book teaches Java Edition.

What happens when you launch a world

Click Create New World, wait a moment, and you drop into a fresh landscape. It feels like the game invented that world on the spot, and in a way it did. A world (the game also calls it a level) is a single Minecraft “universe” that holds all the blocks and entities across each of its dimensions: the Overworld, the Nether, and the End. (Entities are mobs, dropped items, and other moving things.) Its terrain is procedurally generated, built automatically by the game from a set of rules rather than drawn by hand.

Once the world exists, the game has to keep it running. Nearly every video game, Minecraft included, is driven by one big repeating loop, and one trip around that loop is called a tick. Minecraft normally runs at a steady 20 ticks per second, one tick every 0.05 seconds, and almost everything that happens (a furnace smelting, a creeper stepping toward you, day turning to night) is scheduled by counting ticks. An in-game day is exactly 24,000 ticks, which works out to 20 real minutes.

So a world is really two things stacked together: a big pile of definitions (what a creeper is, what a furnace does, what an oak tree looks like) and a clock (the tick) that makes those definitions come alive, moment by moment. The interesting question, the one this whole book answers, is where those definitions come from. That’s the next section.

Minecraft is data-driven

Here’s the part most players never find out: Minecraft does not have “creeper-ness” or “the recipe for a torch” baked permanently into a locked black box. A huge amount of what makes the game the game is stored as plain data, separate files describing each feature, that Minecraft reads when it loads. That’s what people mean when they say Minecraft is data-driven: its behavior is driven by data files, not hand-wired into the program.

How much is stored this way? A lot. The game’s own machinery for this is the data pack, and a single data pack can configure advancements, dimensions, enchantments, loot tables (the lists that decide what a chest or a defeated mob drops), recipes, structures, biomes, and more. Each of those is just data describing “here is what this thing is and how it behaves.”

Modern Minecraft If you follow older tutorials online, you may see data packs treated as an exotic add-on for experts. That’s out of date. In current Minecraft, core systems like enchantments are themselves defined as data you can add to or replace: enchantments live in the game’s data right alongside recipes and loot. Thinking of Minecraft as “a program that reads data” isn’t a clever trick anymore; it’s just how the game is built.

The payoff of a data-driven game is huge for you, and it’s the answer to the wall you hit in Chapter 6. If the game reads its content instead of hard-coding it, then anywhere the game reads a file, you can supply a file, and the game will treat yours exactly as seriously as its own. That’s the escape from buried command blocks: instead of nailing a command into a spot in the world, you write it into a file you can name, search, copy, and hand to a friend. You don’t need to crack open Minecraft’s program. You just need to learn the shape of the data it already expects. That’s the entire skill this book teaches.

Registries: the master lists of everything

If Minecraft reads its content from data, it needs an organized way to keep track of it all: a set of master lists. Those master lists are called registries. A registry is a catalog of one kind of game thing, where every entry has a name the game can look up.

Minecraft has a registry for blocks, a registry for items, a registry for entity types (the kinds of mobs and other moving things), a registry for enchantments, a registry for biomes, and many more. They’re even organized neatly: there’s a single root registry, named minecraft:root, and every other registry is registered inside it. It’s a master list of master lists.

Most registries are meant only for the game’s own internal use. But some, called dynamic registries, are open: content can be added to them through data packs. That openness is what this whole book runs on. The features you’ll spend your time with (recipes, loot tables, enchantments, dimensions, biomes, and more) are exactly the ones the game lets you supply through a data pack. A few of them, like enchantments, biomes, and dimensions, are those open dynamic registries; others, like recipes and loot tables, are simply files the game reads straight out of your pack. Either way, the door is open. When you make a recipe later, you aren’t sneaking something past Minecraft. You’re handing it a file it was always willing to read.

Under the Hood (skippable) Why “registry” and not just “list”? Because a registry does more than hold things. It hands each entry a stable name so the rest of the game can refer to it without confusion. When a command, a recipe, or another data pack needs to point at “the diamond item” or “the plains biome,” it uses that registered name. We’ll meet those names, and the rules for writing them, properly in Chapter 8.

“Vanilla is just a data pack”

Now the sentence that surprises people. The plain, unmodified game, what players call vanilla Minecraft, defines its own features using a built-in data pack. The recipes you craft with, the loot in naturally generated chests, the biomes you explore: a big chunk of that is supplied by a data pack that ships inside the game, read the same way any data pack is read.

Sit with that for a second, because it changes how you should think about everything ahead. Minecraft doesn’t have a special privileged way of defining its content and a second-class hobby way of defining yours. There is just one system. The game reads the vanilla data pack to set itself up, and it reads your data packs the same way, through the same doors, into the same registries.

That’s genuinely good news for a beginner. The “real” way Mojang adds a recipe and the way you’ll add a recipe in Chapter 9 are the same way. What you learn here is how Minecraft actually works, and you’ll be using the real thing yourself.

Java Edition vs. Bedrock Edition (and why this book uses Java)

Before we go further, one fork in the road. Minecraft comes in two main versions, and they are not the same software under the hood.

Java Edition is the original version, first released back in 2009, and it runs on Windows, macOS, and Linux. Its name comes from the Java programming language it’s written in. Crucially for us, Java Edition’s code is the more open and modifiable of the two: it has by far the most established community of mods and custom servers, and the code itself isn’t scrambled to hide it, so people have documented it thoroughly.

Bedrock Edition is the multi-platform version, the one on phones, tablets, consoles, and the Windows “Minecraft for Windows” app. It’s built on a different codebase written in the C++ programming language so it can run on all those devices, and it has its own official add-on system for custom content.

Both editions can be customized, but they customize differently: different file formats, different folders, different rules. A book that tried to teach both at once would have to say “but on the other edition…” in every paragraph, and you’d learn neither well. So this book teaches Java Edition data packs. When you read “Minecraft” from here on, picture Java Edition unless we say otherwise.

Try It! Open Minecraft: Java Edition and start creating a new world. On the More tab of the Create New World screen there’s a Data Packs button. Click it. You’ll see the world already lists data packs available to it, with a place to drop your own in later. You don’t need to add anything yet; just notice that the door is right there, built into the menu. Figure (to be captured). Create New World → More tab → Data Packs screen, with the built-in pack listed

What a data pack actually is (plain English)

We’ve used the words “data pack” a lot. Time to pin them down, in plain language, with no file details yet (those come in Chapter 9).

A data pack is a collection of data that configures features of Minecraft. Physically, it’s nothing fancier than a folder (or a .zip file) that contains a special marker file telling the game “this folder is a data pack.” Drop that folder into a world’s data-pack location and the game will read it, layering your definitions on top of the vanilla ones, adding new features or modifying existing ones.

It helps to know what a data pack is not. Minecraft has a sibling system called a resource pack, and the two are easy to mix up. A resource pack changes how the game looks and sounds (textures, models, music, sound effects, fonts) without changing any behavior. A data pack changes what the game does: its rules, its content, its logic. The slogan to remember: resource packs change appearance; data packs change behavior. Many finished creations use both together (a custom sword needs a data pack to exist and a resource pack to look unique), and we’ll cover resource packs later in the book. But data packs are our main event, because data packs are where you change what Minecraft is.

And that’s the whole foundation. Minecraft reads its content from data; that data is organized into registries; the vanilla game is itself a data pack feeding those registries; and a data pack is just a folder of files you add to the very same system. Everything from here is learning the shapes of those files. The next chapter starts with the language they’re written in.

What Can Go Wrong

This chapter has no files to break, but two misunderstandings trip people up before they even start. Clear them up now:

  • “I’ll need to hack or re-program Minecraft.” No. You never touch Minecraft’s program. You add data files to a system that is designed to read added data files. If you ever feel like you’re fighting the game, you’ve probably wandered off the data-pack path. Step back onto it.
  • “My phone/console Minecraft will work the same as this book.” It won’t. That’s Bedrock Edition, which uses a different add-on system. To follow along, you need Minecraft: Java Edition on a Windows, macOS, or Linux computer.

What You Know Now (so far)

You can explain that Minecraft is data-driven (it reads its content from data files), that registries are the master lists that content lives in, that vanilla itself is a built-in data pack, and that a data pack is a folder of files you add to that same system, and you know this book is about Java Edition. Next chapter, you’ll set up a workshop and learn JSON, the simple language every one of those files is written in.