> For the complete documentation index, see [llms.txt](https://harmex.gitbook.io/cobblebadges/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://harmex.gitbook.io/cobblebadges/datapack-creation/custom-badges.md).

# Custom Badges

{% hint style="info" %}
Refer to [Tutorial: Creating a data pack](https://minecraft.wiki/w/Tutorial:Creating_a_data_pack) to create the base datapack
{% endhint %}

{% hint style="info" %}
Folder Structure\
\- data/<mark style="color:$info;">\[datapack namespace]</mark>/cobblebadges/badges/<mark style="color:$info;">\[badge name]</mark>.json\
\
Badge Identifier\
\- <mark style="color:$info;">\[datapack namespace]</mark>:<mark style="color:$info;">\[badge name]</mark>

Example <mark style="color:$info;">(Bug Badge)</mark>\
\- data/<mark style="color:$info;">cobblebadges</mark>/cobblebadges/badges/<mark style="color:$info;">bug</mark>.json\
\
Badge Identifier\
\- <mark style="color:$info;">cobblebadges</mark>:<mark style="color:$info;">bug</mark>
{% endhint %}

{% hint style="info" %}
Texture Location\
\- assets/<mark style="color:$info;">\[datapack namespace]</mark>/textures/badge/<mark style="color:$info;">\[datapack namespace]</mark>/<mark style="color:$info;">\[badge name]</mark>/<mark style="color:$info;">\[rarity]</mark>.png

Example <mark style="color:$info;">(Bug Badge)</mark>\
\- assets/<mark style="color:$info;">cobblebadges</mark>/textures/badge/<mark style="color:$info;">cobblebadges</mark>/<mark style="color:$info;">bug</mark>/locked.png\
\- assets/<mark style="color:$info;">cobblebadges</mark>/textures/badge/<mark style="color:$info;">cobblebadges</mark>/<mark style="color:$info;">bug</mark>/<mark style="color:$info;">cobblebadges\_poke</mark>.png\
\- assets/<mark style="color:$info;">cobblebadges</mark>/textures/badge/<mark style="color:$info;">cobblebadges</mark>/<mark style="color:$info;">bug</mark>/<mark style="color:$info;">cobblebadges\_great</mark>.png\
\- assets/<mark style="color:$info;">cobblebadges</mark>/textures/badge/<mark style="color:$info;">cobblebadges</mark>/<mark style="color:$info;">bug</mark>/<mark style="color:$info;">cobblebadges\_ultra</mark>.png\
\- assets/<mark style="color:$info;">cobblebadges</mark>/textures/badge/<mark style="color:$info;">cobblebadges</mark>/<mark style="color:$info;">bug</mark>/<mark style="color:$info;">cobblebadges\_master</mark>.png
{% endhint %}

## Data Structure

<pre class="language-jsonc"><code class="lang-jsonc">{
  "name": "[text component]", // See <a data-footnote-ref href="#user-content-fn-1">Text Component Format</a>
  "category": "[category id]", // See <a data-footnote-ref href="#user-content-fn-2">Identifier</a> (the translation key for the category will be 'badge_category.[namespace].[path]')
  "is_hidden": [true | false], // Optional, default: false - It's name, texture and requirements will be hidden in the badge case
  "is_secret": [true | false], // Optional, default: false - The badge won't be present in the badge case until it's unlocked
  "tiers": [
    //WIP
  ]
}
</code></pre>

### Example

A badge named with the translation `key badge.cobblebadges.bug` colored with this color code: #D3D319

It will be present in the category `badge_category.cobblebadges.elemental_type`

```json
{
  "name": {
    "translate": "badge.cobblebadges.bug",
    "color": "#D3D319"
  },
  "category": "cobblebadges:elemental_type",
  "tiers": [
    //WIP
  ]
}
```

[^1]: <https://minecraft.wiki/w/Text_component_format>

[^2]: <https://minecraft.wiki/w/Identifier>
