{"id":40122545,"url":"https://github.com/bbfh-dev/mime","last_synced_at":"2026-02-01T10:04:43.270Z","repository":{"id":333290806,"uuid":"1136822370","full_name":"bbfh-dev/mime","owner":"bbfh-dev","description":"Minecraft data \u0026 resource pack processor designed to be a useful tool for vanilla development","archived":false,"fork":false,"pushed_at":"2026-01-18T13:37:49.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-18T19:25:30.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbfh-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-18T12:28:14.000Z","updated_at":"2026-01-18T13:53:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bbfh-dev/mime","commit_stats":null,"previous_names":["bbfh-dev/mime"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bbfh-dev/mime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbfh-dev%2Fmime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbfh-dev%2Fmime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbfh-dev%2Fmime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbfh-dev%2Fmime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbfh-dev","download_url":"https://codeload.github.com/bbfh-dev/mime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbfh-dev%2Fmime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28568833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T12:50:50.164Z","status":"ssl_error","status_checked_at":"2026-01-19T12:50:42.704Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-19T13:00:34.960Z","updated_at":"2026-02-01T10:04:43.254Z","avatar_url":"https://github.com/bbfh-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📦️ Mime\n\nMinecraft data-driven vanilla data \u0026 resource pack development kit powered by pre-processors and generators with minimum boilerplate and setup.\n\n\u003e Mime uses \u003cq\u003esimple by default, powerful when needed\u003c/q\u003e philosophy.\n\n\u003e [!CAUTION]\n\u003e If you are using Windows (god bless your soul), the behavior of [executable inline templates](#1422-executable-inline-template) is undefined/untested.\n\u003e\n\u003e I have no plans of ever installing Windows to test or debug.\n\n## Table of Contents\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Roadmap before v1](#roadmap-before-v1)\n* [0 Why it exists](#0-why-it-exists)\n* [1 Features](#1-features)\n    * [1.1 Relative resource paths](#11-relative-resource-paths)\n    * [1.2 Nested functions](#12-nested-functions)\n    * [1.3 Mcmeta generation](#13-mcmeta-generation)\n        * [1.3.1 Name](#131-name)\n        * [1.3.2 Minecraft](#132-minecraft)\n        * [1.3.3 Version](#133-version)\n    * [1.4 Templates](#14-templates)\n        * [1.4.1 Substitutions](#141-substitutions)\n        * [1.4.2 Inline templates](#142-inline-templates)\n            * [1.4.2.1 Simple inline template](#1421-simple-inline-template)\n            * [1.4.2.2 Executable inline template](#1422-executable-inline-template)\n            * [1.4.2.3 Invoking inline templates](#1423-invoking-inline-templates)\n        * [1.4.3 Generator templates](#143-generator-templates)\n            * [1.4.3.1 Definitions](#1431-definitions)\n            * [1.4.3.2 Iterators](#1432-iterators)\n* [2 CLI](#2-cli)\n    * [2.1 Installation](#21-installation)\n        * [2.1.1 Pre-built binaries](#211-pre-built-binaries)\n        * [2.1.2 Using Go CLI](#212-using-go-cli)\n    * [2.2 Usage](#22-usage)\n        * [2.2.1 Init](#221-init)\n        * [2.2.2 Main](#222-main)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n# Roadmap before v1\n\n- [ ] Add support for overlays.\n\n# 0 Why it exists\n\nThere exist alternative long-established development kits such as [Beet](https://github.com/mcbeet/beet). **So why does this project exist?**\n\n1. Mime **doesn't force you** to use a specific scripting language (e.g., Python or JavaScript);\n2. Mime **is lightweight**. A project is just `pack.mcmeta` metadata, no environment setups are required.\n3. Mime **is simple**. Any generated files are defined separately as [templates](#14-templates), functions still use `mcfunction` with the addition of [sugar-code](#1-features).\n4. Mime **is a statically-linked binary**. That means it's portable and performant.\n\n# 1 Features\n\n## 1.1 Relative resource paths\n\nAny mention of `./` will be replaced with the path to the current file as a resource.\n\n```mcfunction\n# File: data/example/function/load.mcfunction\nfunction ./_my_nested_function\n```\n\n\u003e 📂 **Produces:**\n\u003e\n\u003e ```mcfunction\n\u003e # File: data/example/function/load.mcfunction\n\u003e function example:load/_my_nested_function\n\u003e ```\n\n## 1.2 Nested functions\n\nCreate nested functions by adding indentation (must be a tab or 4 spaces) to code, subsequent to a function call.\n\n```mcfunction\n# File: data/example/function/test.mcfunction\nexecute as @e run function ./_my_nested_function\n    say 123\n    kill @s\n```\n\n\u003e 📂 **Produces:**\n\u003e\n\u003e ```mcfunction\n\u003e # File: data/example/function/test.mcfunction\n\u003e execute as @e run function example:test/_my_nested_function\n\u003e ```\n\u003e\n\u003e ```mcfunction\n\u003e # File: data/example/function/test/_my_nested_function.mcfunction\n\u003e say 123\n\u003e kill @s\n\u003e ```\n\n## 1.3 Mcmeta generation\n\n`pack.mcmeta` files for both data \u0026 resource packs are automatically generated with the appropriate format based on supported Minecraft versions.\n\n```jsonc\n// Local pack.mcmeta\n{\n    \"pack\": {\n        \"description\": \"This is my pack\"\n    },\n    \"meta\": {\n        \"name\": \"example\",\n        \"minecraft\": {\n            \"min\": \"1.20\",\n            \"max\": \"1.21.1\"\n        },\n        \"version\": \"0.1.0-alpha\"\n    }\n}\n```\n\n\u003e 📂 **Produces:**\n\u003e\n\u003e ```jsonc\n\u003e // build/data_pack/pack.mcmeta\n\u003e {\n\u003e     \"pack\": {\n\u003e         \"description\": \"This is my pack\",\n\u003e         \"pack_format\": 48,\n\u003e         \"min_format\": [48, 0],\n\u003e         \"max_format\": [94, 1]\n\u003e     },\n\u003e     \"meta\": {\n\u003e         \"name\": \"example\",\n\u003e         \"minecraft\": {\n\u003e             \"min\": \"1.20\",\n\u003e             \"max\": \"1.21.1\"\n\u003e         },\n\u003e         \"version\": \"0.1.0-alpha\"\n\u003e     }\n\u003e }\n\u003e ```\n\n### 1.3.1 Name\n\nField `meta.name` must be a `string`.\nIt is used to generate `.zip` files[⁽¹⁾](#22-usage).\n\n### 1.3.2 Minecraft\n\nField `meta.minecraft` must be one of:\n- a `string` with the Minecraft version;\n- an `object` containing `min` and `max` fields with the minimum and maximum Minecraft versions, respectively;\n\n### 1.3.3 Version\n\nThe project's version. It is recommended to use [semantic versioning](https://semver.org/), it is not enforced.\nIt is used to generate `.zip` files[⁽¹⁾](#22-usage).\n\n## 1.4 Templates\n\nTemplates enable data-driven generation of data \u0026 resource pack files.\n\nThey are defined using a `templates/\u003ctemplate_name\u003e/manifest.json` file at the root of the project.\n\nSee [Examples / 02_templates](./examples/02_templates) for examples.\n\n### 1.4.1 Substitutions\n\nTemplate file contents and file/directory names can be formatted with variables by using `%[\u003cname\u003e]`.\n\nDepending on the context, `\"%[\u003cname\u003e]\"` inside of `.json` files can be substituted with any value, not just a string.\n\n- Iterators can contain an index (defaults to 0) when necessary e.g. `%[\u003citerator\u003e.1]` or `%[\u003citerator\u003e.2]`.\n- Variables can contain modifiers e.g. `[\u003cname\u003e.\u003cmodifier\u003e]`:\n    - `to_file_name`: limits the value to `[a-z+_]` charset (whitespace gets replaced with an `_`).\n    - `to_lower_case`: converts the string to all lower case.\n    - `to_upper_case`: converts the string to all upper case.\n    - `length`: converts to the length of the string.\n\n```jsonc\n{\n    \"key\": \"%[value]\"\n}\n\n// Could become:\n{\n    \"key\": \"my_value\"\n}\n\n// Or, depending on the input:\n{\n    \"key\": {\n        \"literally\": \"anything\"\n    }\n}\n```\n\n\u003e [!NOTE]\n\u003e An `%[id]` is always provided as the unique identifier of the `definitions/` file (with all iterators substituted).\n\u003e\n\u003e Usually, all files must contain this in their path to prevent clashing (when different definitions try to create the same file).\n\n### 1.4.2 Inline templates\n\nAllow you to add new syntax to `mcfunction` files.\n\n```jsonc\n// manifest.json\n{\n    \"$schema\": \"https://raw.githubusercontent.com/bbfh-dev/mime/refs/heads/main/resources/manifest_schema.json\",\n    \"type\": \"inline\",\n    // (Example) requires 3 positional arguments.\n    \"arguments\": [\n        \"arg1\",\n        \"arg2\",\n        \"arg3\"\n    ],\n    // (Example) don't define \"arguments\" or set it to \"null\"\n    // if you want any number of input arguments\n    // NOTE: all arguments are provided as a single string argument\n    \"arguments\": null\n}\n```\n\nThe contents of the template can be one of the following:\n\n#### 1.4.2.1 Simple inline template\n\nCreate a `body.mcfunction` file. Its contents will be inserted in place of the invocation.\n\nUse `%[...]` to place any nested code.\n\nExample:\n```mcfunction\n# for/body.mcfunction\n# this is an example '#!/for @s my_objective ..5' for-loop implementation\nscoreboard players set %[target] %[objective] 0\nfunction ./_for_each_%[target.to_file_name]\n\t%[...]\n\tscoreboard players add %[target] %[objective] 1\n\texecute if score %[target] %[objective] matches %[range] run function ./_for_each_%[target.to_file_name]\n```\n\n#### 1.4.2.2 Executable inline template\n\nCreate a `call` file; it can optionally have any extension (e.g., `call.py` or `call.sh` is valid) as long as it is an executable.\n\nExample:\n```sh\n#!/bin/sh\n\necho \"$*\"\ncat # this will print all nested code right after\n```\n\n#### 1.4.2.3 Invoking inline templates\n\nWhile inside of `mcfunction` files, you can use `#!/\u003ctemplate_name\u003e \u003cargs...\u003e` syntax. The inline template will be written in place of the line.\n\nAny nested code will be fed to the template.\n\n```mcfunction\n#!/for @s my_objective ..5\n    say 123\n    say abc\n```\n\n### 1.4.3 Generator templates\n\nAs the name suggests, they generate files from a user-defined list of items.\n\n```jsonc\n// manifest.json\n{\n    \"$schema\": \"https://raw.githubusercontent.com/bbfh-dev/mime/refs/heads/main/resources/manifest_schema.json\",\n    \"type\": \"generator\",\n    // (Example) define 2 iterators\n    \"iterators\": {\n        \"material\": [\n            [\n                \"acacia\",\n                \"acacia_planks\"\n            ],\n            [\n                \"oak\",\n                \"oak_planks\"\n            ],\n            [\n                \"spruce\",\n                \"spruce_planks\"\n            ],\n            [\n                \"stone\",\n                \"stone_bricks\"\n            ]\n        ],\n        \"color\": [\n            \"red\",\n            \"green\",\n            \"blue\"\n        ]\n    }\n}\n```\n\nCreate your regular minecraft files inside the `data/` \u0026 `assets/` directories, which will be merged with the data/resource pack. Note, that paths should use substitutions preferably with `%[id]` to avoid clashing.\n\n#### 1.4.3.1 Definitions\n\nDefine `definitions/\u003cname\u003e.json` files, optionally using previously defined iterators. The contents off the files will be provided to every data/resource pack file for substitution.\n\n```jsonc\n// Example, you can put anything in here:\n{\n    \"block\": \"%[material.1]\",\n    \"recipe\": [\n        {\n            \"id\": 1,\n            \"name\": \"some item here\"\n        }\n    ]\n}\n```\n\n#### 1.4.3.2 Iterators\n\nIterators allow you to generate definitions for every unique combination of values.\n\nExample:\n```bash\n# File:\n%[color]_%[material]_chair.json\n\n# Would generate (assuming you are using the iterators from the example above):\nred_acacia_chair.json\ngreen_acacia_chair.json\nblue_acacia_chair.json\nred_oak_chair.json\ngreen_oak_chair.json\n# etc...\n```\n\nThe definition file will be substituted with the current iterator value.\n\n# 2 CLI\n\n## 2.1 Installation\n\n### 2.1.1 Pre-built binaries\n\n1. Download the [latest release](https://github.com/bbfh-dev/mime/releases/latest) for your OS and architecture.\n2. Put it into a directory listed in your `$PATH`;\n\n### 2.1.2 Using Go CLI\n\n1. Assuming you have [Go](https://go.dev/) installed;\n2. Run `go install github.com/bbfh-dev/mime@latest`\n\n## 2.2 Usage\n\n### 2.2.1 Init\n\nThis utility is used to initialize a new Mime project or convert an existing data/resource pack into the appropriate format.\n\nUnder the hood, it simply writes fields to `pack.mcmeta`, as this is the only requirement for Mime.\n\n```\nInitialize a new Mime project\n\n[?] Usage:\n    init [options...] \u003cwork-dir?\u003e\n\n[#] Options:\n    --help\n        # Print this help message and exit\n    --name, -n \u003cstring\u003e (default: untitled)\n        # Specify the project name that will be used for exporting\n    --minecraft, -m \u003cstring\u003e (default: 1.21.11)\n        # Specify the target Minecraft version. Use '-' to indicate version ranges, e.g. '1.20-1.21'\n    --version, -v \u003cstring\u003e (default: 0.1.0-alpha)\n        # Specify the project version using semantic versioning\n    --description, -d \u003cstring\u003e\n        # Specify the project description\n```\n\nExample usage:\n```bash\n# Note that all of the flags are optional\n$ mime init ./examples/01_basic --name=untitled --pack-version=1.0.0 --minecraft=1.21.11 --description \"Hello World!\"\n```\n\n### 2.2.2 Main\n\n```\nMinecraft data-driven vanilla data \u0026 resource pack development kit powered by pre-processors and generators\n\n[?] Usage:\n    mime [options...] \u003cwork-dir?\u003e\n\n[\u003e] Commands:\n    init\n        # Initialize a new Mime project\n\n[#] Options:\n    --help\n        # Print this help message and exit\n    --version\n        # Print program version and exit\n    --output, -o \u003cstring\u003e (default: ./build)\n        # Output directory relative to the pack working dir\n    --zip, -z\n        # Export data \u0026 resource packs as .zip files\n    --debug, -d\n        # Print verbose debug information\n    --force, -f\n        # Force build even if the project was cached\n```\n\nExample usage:\n```bash\n$ mime -o /tmp/mime-build --zip --debug ./examples/02_templates\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbfh-dev%2Fmime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbfh-dev%2Fmime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbfh-dev%2Fmime/lists"}