Skip to content

deveworld/cobble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cobble

A modern, Python-like language for creating Minecraft Data Packs

Rust Minecraft Pack Format Web Demo

Cobble web demo preview

Cobble transpiles .cbl source into Minecraft Java Edition data packs. It lets you write functions, events, resources, and command-heavy logic with a Python-like syntax while still emitting plain .mcfunction, pack.mcmeta, tag, and JSON resource files.

Cobble 0.6.3 targets Minecraft Java Edition 26.1.2 and pack format 101.1.

Website And Web Demo

Website: https://deveworld.github.io/cobble/ Browser compiler: https://deveworld.github.io/cobble/try/

The website introduces Cobble with short examples and links to the browser compiler at /try. The compiler runs Cobble's Rust parser and transpiler through WebAssembly, so you can inspect generated functions, resources, metadata, diagnostics, and data pack ZIP output without installing the CLI.

Warning

Cobble is pre-1.0 software in active development. Bugs and API changes are still possible. Please report issues at https://github.com/deveworld/cobble/issues.

Features

  • Python-like syntax for functions, indentation, imports, and control flow
  • Static type inference for variables, constants, and expressions
  • Data pack output for functions, event tags, predicates, advancements, loot tables, recipes, item modifiers, and dialogs
  • Minecraft command handling with JSON safety, macro parameters, and command validation
  • Standard library helpers for events, text, scoreboards, storage, schedules, bossbars, teams, and entities
  • CLI workflow for project templates, build, check, watch, validation, and ZIP output
  • Browser playground powered by Rust and WebAssembly

Installation

cargo install cobble-lang
cobble --help

The crates.io package is named cobble-lang; the installed command is cobble.

To build from source:

git clone https://github.com/deveworld/cobble.git
cd cobble
cargo build --release

Quick Start

cobble init --name my-datapack
cd my-datapack

Edit src/main.cbl:

import stdlib
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)

Build the data pack:

cobble build --validate --zip

Copy the generated output to your world's datapacks directory:

.minecraft/saves/YourWorld/datapacks/

Commands

Command Purpose
cobble init Create a new project
cobble build Build source files into a data pack
cobble check Check Cobble syntax without building
cobble doctor Inspect project and validation environment status
cobble inspect Summarize generated build metadata
cobble validate Validate generated .mcfunction files
cobble watch Rebuild when source files change

Use cobble build --dry-run to compile and inspect the output plan without writing the final data pack. Each build writes .cobble/build_manifest.json with the Cobble version, Minecraft target, pack format, source inputs, generated resource entries, validation summary when available, and generated file counts. Use cobble inspect output/ to summarize that metadata after a build. Use cobble build --quiet when a script only needs the exit code.

cobble build --validate and cobble validate check generated .mcfunction files against Minecraft Java Edition 26.1.2 commands. The default data/commands.json file is generated automatically on first validation when missing; this requires curl and Java.

Configuration

cobble.toml controls the project namespace, pack metadata, source directory, output directory, and entry points.

[project]
name = "my-datapack"
namespace = "my_namespace"
version = "1.0.0"
pack_format = "101.1"

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

Development

cargo test --locked

cd web
npm install
npm run dev

Documentation

Support

License

Cobble is licensed under the MIT License. See LICENSE.

About

A Python-like language that compiles to Minecraft data packs

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors