{"id":37078622,"url":"https://github.com/vberlier/mcpack","last_synced_at":"2026-01-14T09:12:13.267Z","repository":{"id":55560143,"uuid":"137604662","full_name":"vberlier/mcpack","owner":"vberlier","description":":warning: Please migrate to https://github.com/vberlier/beet","archived":true,"fork":false,"pushed_at":"2020-12-22T04:12:33.000Z","size":199,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-13T15:34:36.049Z","etag":null,"topics":["advancement","datapack","deprecated","mcfunction","minecraft","structure-file"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vberlier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["vberlier"]}},"created_at":"2018-06-16T19:15:40.000Z","updated_at":"2025-08-24T08:53:42.000Z","dependencies_parsed_at":"2022-08-15T03:10:53.267Z","dependency_job_id":null,"html_url":"https://github.com/vberlier/mcpack","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/vberlier/mcpack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vberlier%2Fmcpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vberlier%2Fmcpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vberlier%2Fmcpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vberlier%2Fmcpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vberlier","download_url":"https://codeload.github.com/vberlier/mcpack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vberlier%2Fmcpack/sbom","scorecard":{"id":917157,"data":{"date":"2025-08-18","repo":{"name":"github.com/vberlier/mcpack","commit":"e48eb9368a832aa5193b86a870b94f6ac6e912db"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"16 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2022-42986 / GHSA-43fp-rhv2-5gv8","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-6p56-wp2h-9hxr","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2021-59 / GHSA-5phf-pp7p-vc2r","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2021-108 / GHSA-q2q7-5pp4-w6pg","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T21:27:32.847Z","repository_id":55560143,"created_at":"2025-08-24T21:27:32.847Z","updated_at":"2025-08-24T21:27:32.847Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["advancement","datapack","deprecated","mcfunction","minecraft","structure-file"],"created_at":"2026-01-14T09:12:12.538Z","updated_at":"2026-01-14T09:12:13.255Z","avatar_url":"https://github.com/vberlier.png","language":"Python","funding_links":["https://github.com/sponsors/vberlier"],"categories":[],"sub_categories":[],"readme":"\u003ch3 align=\"center\"\u003e⚠️ THIS PROJECT IS DEPRECATED ⚠️\u003c/h3\u003e\n\u003ch3 align=\"center\"\u003ePlease migrate to \u003ca href=\"https://github.com/vberlier/beet\"\u003ehttps://github.com/vberlier/beet\u003c/a\u003e\u003c/h3\u003e\n\n---\n\n# mcpack\n\n[![Build Status](https://travis-ci.com/vberlier/mcpack.svg?branch=master)](https://travis-ci.com/vberlier/mcpack)\n[![PyPI](https://img.shields.io/pypi/v/mcpack.svg)](https://pypi.org/project/mcpack/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mcpack.svg)](https://pypi.org/project/mcpack/)\n\n\u003e A python library for programmatically creating and editing [Minecraft data packs](https://minecraft.gamepedia.com/Data_pack). Requires python 3.7.\n\n```py\nfrom mcpack import DataPack, Function\n\npack = DataPack('My cool pack', 'This is the description of my pack.')\n\npack['my_cool_pack:hello'] = Function(\n    'say Hello, world!\\n'\n    'give @s minecraft:dead_bush\\n'\n)\n\npack.dump('.minecraft/saves/New World/datapacks')\n```\n\n## Installation\n\nMake sure that you're using python 3.7 or above. The package can be installed with `pip`.\n\n```sh\n$ pip install mcpack\n```\n\n## Using mcpack\n\n\u003e Check out the [examples](https://github.com/vberlier/mcpack/tree/master/examples) for a quick overview.\n\n### Creating a data pack\n\nThe `DataPack` class represents a minecraft data pack.\n\n```py\nfrom mcpack import DataPack\n\npack = DataPack('Test', 'Test description.')\n\nprint(pack.name)  # 'Test'\nprint(pack.description)  # 'Test description.'\nprint(pack.pack_format)  # 1\nprint(pack.namespaces)  # defaultdict(\u003cclass 'mcpack.Namespace'\u003e, {})\n```\n\nYou can load already existing data packs using the `load` class method.\n\n```py\nfrom mcpack import DataPack\n\npack = DataPack.load('.minecraft/save/New World/datapacks/Test')\n```\n\nThe `dump` method allows you to generate the actual Minecraft data pack. The method will raise a `ValueError` if the data pack already exists. You can explicitly overwrite the existing data pack by setting the `overwrite` argument to `True`.\n\n```py\nfrom mcpack import DataPack\n\npack = DataPack('Test', 'Test description.')\n\npack.dump('.minecraft/save/New World/datapacks')\npack.dump('.minecraft/save/New World/datapacks', overwrite=True)\n```\n\n### Namespaces\n\n`Namespace` objects hold references to data pack items using a separate dictionary for each type of item.\n\n```py\nfrom mcpack import Namespace\n\nnamespace = Namespace()\n\nprint(namespace.advancements)  # {}\nprint(namespace.functions)  # {}\nprint(namespace.loot_tables)  # {}\nprint(namespace.recipes)  # {}\nprint(namespace.structures)  # {}\nprint(namespace.block_tags)  # {}\nprint(namespace.item_tags)  # {}\nprint(namespace.fluid_tags)  # {}\nprint(namespace.function_tags)  # {}\nprint(namespace.entity_type_tags)  # {}\n```\n\nYou can add namespaces to `DataPack` objects using the `namespaces` attribute. Note that you won't usually need to create namespaces yourself. If you want to edit a namespace, you just need to retrieve it and the `defaultdict` will create an empty namespace for you if it doesn't already exist.\n\n```py\nfrom mcpack import DataPack\n\npack = DataPack('Test', 'Test description.')\n\nprint(pack.namespaces['test'])  # Namespace(...)\n```\n\nTo make things even more convenient, the `__getitem__` and `__setitem__` methods of `DataPack` objects are mapped to the `namespaces` attribute. It means that you can access namespaces directly from the `DataPack` object.\n\n```py\nprint(pack['test'])  # Namespace(...)\n```\n\nAdding items to namespaces is pretty straight-forward. Simply add them to their respective dictionaries.\n\n```py\nfrom mcpack import (DataPack, Advancement, Function, LootTable, Recipe,\n                    Structure, BlockTag, ItemTag, FluidTag, FunctionTag,\n                    EntityTypeTag)\n\npack = DataPack('Test', 'Test description.')\n\npack['test'].advancements['foo'] = Advancement(...)\npack['test'].functions['foo/spam'] = Function(...)\npack['test'].loot_tables['foo/egg'] = LootTable(...)\npack['test'].recipes['bar'] = Recipe(...)\npack['test'].structures['bar/spam'] = Structure(...)\npack['test'].block_tags['bar/egg'] = BlockTag(...)\npack['test'].item_tags['baz'] = ItemTag(...)\npack['test'].fluid_tags['baz/spam'] = FluidTag(...)\npack['test'].function_tags['baz/egg'] = FunctionTag(...)\npack['test'].entity_type_tags['qux'] = EntityTypeTag(...)\n```\n\nYou can also use the `DataPack` object directly. The `__setitem__` method actually checks if the key looks like `namespace:path` and dispatches the item automatically. We can now simplify the previous piece of code quite a bit.\n\n```py\nfrom mcpack import (DataPack, Advancement, Function, LootTable, Recipe,\n                    Structure, BlockTag, ItemTag, FluidTag, FunctionTag,\n                    EntityTypeTag)\n\npack = DataPack('Test', 'Test description.')\n\npack['test:foo'] = Advancement(...)\npack['test:foo/spam'] = Function(...)\npack['test:foo/egg'] = LootTable(...)\npack['test:bar'] = Recipe(...)\npack['test:bar/spam'] = Structure(...)\npack['test:bar/egg'] = BlockTag(...)\npack['test:baz'] = ItemTag(...)\npack['test:baz/spam'] = FluidTag(...)\npack['test:baz/egg'] = FunctionTag(...)\npack['test:qux'] = EntityTypeTag(...)\n```\n\n### Advancements\n\n`Advancement` objects represent Minecraft advancements.\n\n```py\nfrom mcpack import DataPack, Advancement\n\npack = DataPack('Test', 'Test description.')\npack['test:foo'] = Advancement()\n\nadvancement = pack['test'].advancements['foo']\n\nprint(advancement.display)  # None\nprint(advancement.parent)  # None\nprint(advancement.criteria)  # {}\nprint(advancement.requirements)  # None\nprint(advancement.rewards)  # None\n```\n\nAll the attributes can be set in the constructor. They mirror the root properties of the advancement JSON file format.\n\n\u003e Check out the [wiki](https://minecraft.gamepedia.com/Advancements) for further details.\n\n### Functions\n\n`Function` objects represent Minecraft functions.\n\n```py\nfrom mcpack import DataPack, Function\n\npack = DataPack('Test', 'Test description.')\npack['test:foo'] = Function()\n\nfunction = pack['test'].functions['foo']\n\nprint(function.body)  # ''\n```\n\nThe `body` attribute can be set in the constructor. The body of the function corresponds to the content of the actual `.mcfunction` file.\n\n\u003e Check out the [wiki](https://minecraft.gamepedia.com/Function) for further details.\n\n### Loot tables\n\n`LootTable` objects represent Minecraft loot tables.\n\n```py\nfrom mcpack import DataPack, LootTable\n\npack = DataPack('Test', 'Test description.')\npack['test:foo'] = LootTable()\n\nloot_table = pack['test'].loot_tables['foo']\n\nprint(loot_table.pools)  # []\nprint(loot_table.type)  # 'generic'\nprint(loot_table.functions) # None\n```\n\nAll the attributes can be set in the constructor. They mirror the root properties of the loot table JSON file format.\n\n\u003e Check out the [wiki](https://minecraft.gamepedia.com/Loot_table) for further details.\n\n### Recipes\n\n`Recipe` objects represent Minecraft recipes.\n\n```py\nfrom mcpack import DataPack, Recipe\n\npack = DataPack('Test', 'Test description.')\npack['test:foo'] = Recipe()\n\nrecipe = pack['test'].recipes['foo']\n\nprint(recipe.type)  # 'crafting_shaped'\nprint(recipe.group)  # None\nprint(recipe.pattern)  # []\nprint(recipe.key)  # {}\nprint(recipe.ingredient)  # None\nprint(recipe.ingredients)  # None\nprint(recipe.result)  # {}\nprint(recipe.experience)  # None\nprint(recipe.cookingtime)  # None\nprint(recipe.count)  # None\n```\n\nAll the attributes can be set in the constructor. They mirror the root properties of the recipe JSON file format.\n\n\u003e Check out the [wiki](https://minecraft.gamepedia.com/Recipe) for further details.\n\n### Structures\n\n`Structure` objects represent Minecraft structures.\n\n```py\nfrom mcpack import DataPack, Structure\n\npack = DataPack('Test', 'Test description.')\npack['test:foo'] = Structure()\n\nstructure = pack['test'].structures['foo']\n\nprint(structure.data_version)  # Int(1503)\nprint(structure.author)  # String('')\nprint(structure.size)  # List[Int]([0, 0, 0])\nprint(structure.palette)  # List[State]([])\nprint(structure.palettes)  # List[List[State]]([])\nprint(structure.blocks)  # List[Block]([])\nprint(structure.entities)  # List[Entity]([])\n```\n\nAll the attributes can be set in the constructor. They mirror the root properties of the structure NBT file format. `mcpack` uses [`nbtlib`](https://github.com/vberlier/nbtlib) to manipulate nbt data. The `Structure` class inherits from an `nbtlib` schema that takes care of wrapping python values with the appropriate nbt tags.\n\n\u003e Check out the [wiki](https://minecraft.gamepedia.com/Structure_block_file_format) for further details.\n\n### Tags\n\n`BlockTag`, `ItemTag`, `FluidTag`, `FunctionTag` and `EntityTypeTag` objects represent Minecraft block, item, fluid, function and entity type tags respectively. They are all identical in structure, the only difference between them is the namespace directory they get written to.\n\n```py\nfrom mcpack import DataPack, BlockTag\n\npack = DataPack('Test', 'Test description.')\npack['test:foo'] = BlockTag()\n\nblock_tag = pack['test'].block_tags['foo']\n\nprint(block_tag.values)  # []\nprint(block_tag.replace)  # False\n```\n\nThe `values` and `replace` attributes can be set in the constructor. They mirror the root properties of the tag JSON file format.\n\n\u003e Check out the [wiki](https://minecraft.gamepedia.com/Tag) for further details.\n\n## Contributing\n\nContributions are welcome. This project uses [`poetry`](https://poetry.eustace.io/) so you'll need to install it first if you want to be able to work with the project locally.\n\n```sh\n$ curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python\n```\n\nYou should now be able to install the required dependencies.\n\n```sh\n$ poetry install\n```\n\nYou can run the tests with `poetry run pytest`.\n\n```sh\n$ poetry run pytest\n```\n\nThe project can also download the latest minecraft releases and run tests against the vanilla data pack. You can enable these tests by using the `--vanilla` flag.\n\n```sh\n$ poetry run pytest --vanilla\n```\n\n---\n\nLicense - [MIT](https://github.com/vberlier/mcpack/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvberlier%2Fmcpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvberlier%2Fmcpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvberlier%2Fmcpack/lists"}