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

Cobble

Cobble is a Python-like language that compiles to Minecraft Java Edition data packs. You write functions, events, conditions, loops, and resources in .cbl files, and the compiler turns them into .mcfunction files, function tags, and JSON resources.

from stdlib import event

def on_load():
    /tellraw @a {"text":"Cobble loaded","color":"green"}

def reward(player, amount):
    /give {player} minecraft:diamond {amount}

stdlib.addEventListener(event.LOAD, on_load)

Cobble targets Minecraft Java Edition 26.3 (pack format 121.0). The current crates.io release is 0.10.0. This is the nightly documentation, built from the main branch, where 0.11 is in development. What it says about 0.11, such as the per-pack <namespace>.vars objective and persist variables, may change before the release.

Where To Start

You can also try Cobble without installing anything in the browser compiler.