Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi. I'm having trouble with my mod's creative tab.

 

My mod's creative tab does work, but it only works if I replace a tab. The code below is in my main mod file. I have set it to 0, so it replaces the "Building Blocks" tab. It works with numbers 0 to 11 (11 being the inventory), but if I set it to 12, the game crashes before the mojang screen comes up

public static final CrystalTab tabCrystal = new CrystalTab(0, "tabCrystal");

 

Am I doing something wrong?

 

Here's the class file for my mod's tab.

package com.testing.crystals;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class CrystalTab extends CreativeTabs {

public CrystalTab(int index, String label) {
	super(index, label);
	this.setBackgroundImageName("crystal.png");
}

@Override
public Item getTabIconItem() {
	return CrystalItems.crystal_red;
}

}

Wrong constructor m8.

 

public CrystalTab(String label) {
	super(label);
	this.setBackgroundImageName("crystal.png");
}

1.7.10 is no longer supported by forge, you are on your own.

Not. Possible.

 

public CreativeTabs(String label)
    {
        this(getNextID(), label);
    }

    public CreativeTabs(int index, String label)
    {
        if (index >= creativeTabArray.length)
        {
            CreativeTabs[] tmp = new CreativeTabs[index + 1];
            for (int x = 0; x < creativeTabArray.length; x++)
            {
                tmp[x] = creativeTabArray[x];
            }
            creativeTabArray = tmp;
        }
        this.tabIndex = index;
        this.tabLabel = label;
        creativeTabArray[index] = this;
    }

 

1st one is used to add next CT, 2nd allows you to override tab with index.

 

public class MyTab extends CreativeTabs
{
public MyTab(String label)
{
	super(label);
}

...
}

1.7.10 is no longer supported by forge, you are on your own.

  • Author

Can't seem to get it to work. So I setup a new workspace and moved my mod to it. Managed to get it working. Don't think I set the workspace up correctly or something.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.