Creative tab registry.


Creating a registry. 0.2>



In order to register creative tabs you will have to create a registry. To do this, you must use the following code within the init() function:

                    
//This is the init() inside your main class.
public static void init() {
    //Here we create the registry so we can use it later.
    CreativeTabRegistry.CreateRegistry(MOD_ID);
}
                    
                

Creating a creative tab. 0.2>



In order to register a creative tab you will have to create a registry, then create the creative tab and finally register them all. I recommend that you separate each type of registry into a separate class, meaning, if you are going to register creative tabs, do it in a class separate from the others; this way, you can organize yourself more easily.

                    
//This is another separate class from the initial one. I recommend you do this for organization.
public class CreativeTabRegister {
    //Here we create the creative tab.
    public static final RestCreativeTab tab = CreativeTabRegistry.CreateCreativeTab(MOD_ID, "CREATIVE_TAB_ID", "ITEM_ID_AS_ICON");

    /*
        Parameters:
            - MOD_ID = Your mod id as string.
            - "CREATIVE_TAB_ID"= Your creative tab's id as string.
            - "ITEM_ID_AS_ICON" = The icon that will be seen in the creative tab. It's a string with the item's ID.
    */

    //You can create a method/function like this to call it from the main class.
    public static void register() {
        //This registers all of your creative tabs into minecraft.
        CreativeTabRegistry.Register(Testing.MOD_ID);
    }
}
                    
                
                    
//This is another separate class from the initial one. I recommend you do this for organization.
public class CreativeTabRegister {
    //Here we create the creative tab.
    public static final Object tab = CreativeTabRegistry.CreateCreativeTab(MOD_ID, "CREATIVE_TAB_ID", "ITEM_ID_AS_ICON");

    /*
        Parameters:
            - MOD_ID = Your mod id as string.
            - "CREATIVE_TAB_ID"= Your creative tab's id as string.
            - "ITEM_ID_AS_ICON" = The icon that will be seen in the creative tab. It's a string with the item's ID.
    */

    //You can create a method/function like this to call it from the main class.
    public static void register() {
        //This registers all of your creative tabs into minecraft.
        CreativeTabRegistry.Register(Testing.MOD_ID);
    }
}