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

Project Configuration

cobble init writes a cobble.toml at the project root:

[project]
name = "my_datapack"
description = "my_datapack Data Pack"
namespace = "my_datapack"
version = "1.0.0"
pack_format = "121.0"

[build]
source = "src"
output = "output"
entry_points = []

[stdlib]
version = 2

[experimental]
resource_pack = false
plugins = false
python_compat = false
KeyMeaning
project.nameProject name.
project.descriptionPack description written to pack.mcmeta.
project.namespaceNamespace for functions, resources, the <namespace>.vars objective, and the <namespace>:global storage. Lowercase, no spaces.
project.versionYour project’s version; Cobble does not use it.
project.pack_formatMust be 121.0 (or 121).
build.sourceSource directory. Default src.
build.outputOutput directory. Default output.
build.entry_pointsFiles to compile, relative to build.source. Imports are resolved from these files. Empty means every file in the source directory.
stdlib.version2 (default) requires per-module stdlib imports; 1 is deprecated. See Standard Library Modules.
experimental.resource_packEnables resource-pack output.
experimental.pluginsEnables the plugin diagnostics in cobble check. See Experimental Features.
experimental.python_compatAdds the Python compatibility report to cobble check.

Unknown keys, misplaced keys, and experimental flags that are not booleans are errors. Command-line options such as --namespace and --output override the file for one build.

Supported Minecraft Version

MinecraftPack format
Java Edition 26.3121.0

Cobble targets one Minecraft version at a time and rejects other pack formats. pack.mcmeta gets min_format and max_format set to [121, 0].

Output Layout

output/
├── pack.mcmeta
├── .cobble/
│   ├── build_manifest.json
│   └── source_map.json
└── data/
    ├── minecraft/
    │   └── tags/
    │       └── function/
    │           ├── load.json
    │           └── tick.json
    └── my_datapack/
        └── function/
            ├── _cobble_init.mcfunction
            ├── on_load.mcfunction
            └── ...

Resource declarations add folders such as data/<namespace>/predicate/, and resource-pack output adds assets/. The .cobble/ files are described in Metadata Files.