# Create a Custom Tab

Creating or configuring a custom tab, is done through JSON from either a Resource or Data pack. For this explanation, we will be using a resource pack.


# Getting Started

The first thing you want to do is, create a new, empty resource pack. To save you some time, you can also download the SKELETON PACK with all the base files already created.

Inside your resource pack, you will need the following folder layout:

|-- Pack Folder
    |-- assets
        |-- minecraft
            |-- lang
                |-- en_us.json
            |-- morecreativetabs
                |-- my_tab.json
    |-- pack.mcmeta

# Creating your first tab

To create a new creative tab, create a file inside the morecreativetabs folder. You can call this whateveryouwant.json. This file will tell the mod how to configure the creative tab.

You will also need a lang file inside the lang folder. For this example, we will use en_us.json which is the english version of the tab names.

Below is a sample config file, with an explanation at the bottom:

{
  "tab_enabled": true,
  "tab_name": "lighting",
  "tab_icon": "minecraft:lantern",
  "tab_items": [
    {
      "name": "minecraft:light",
      "hide_old_tab": true,
      "nbt": "{BlockStateTag: {level:\"4\"}}"
    },
    {
      "name": "minecraft:torch"
    },
	{
      "name": "minecraft:soul_torch"
    },
	{
      "name": "minecraft:candle"
    }
  ]
}

Explanation:

Item/Variable Purpose
"tab_enabled" Should this custom tab be loaded by the mod
"tab_name" The translation key used in the lang file. For example: lighting_tab. This will be prefixed with morecreativetabs. So lighting_tab will become morecreativetabs.lighting_tab
"tab_icon" The registry name of the item to use as the tab icon. This must always be in format modid:itemname. You can find this by dropping an item on the ground and looking at it, with F3 active
"tab_items" This contains a reference to all the items contained in the tab
"name" The registry name of the item to use as the tab icon. This must always be in format modid:itemname. You can find this by dropping an item on the ground and looking at it, with F3 active
"hide_old_tab" -> Optional When present and enabled, the item will be removed from its original tab, and only be shown in the custom tab
"nbt" -> Optional Pretty self explanatory, but this allows you to set NBT values on an item inside the tab

# More examples

Here you can download a couple of pre-made packs, to see how they work and make your own from them.