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

I have been working on my mod, and everything is working pretty well, but I've been waiting for a good creative tab tutorial for a while. basically, in 1.7 i could do this:

 

 

public class ModTabs{

 

public static CreativeTabs Tab1;

public static CreativeTabs Tab2;

 

public static void init() {

Tab1 = new CreativeTabs("Tab One"){

public Item getTabIconItem(){

return ModItems.Icon1;

}

};

Tab2 = new CreativeTabs("Tab Two"){

public Item getTabIconItem() {

return ModItems.Icon2;

}

};

//repeat

}

}

 

public class Icon1 extends Item {

 

public Icon1() {

setUnlocalizedName("Icon1");

setRegistryName("Icon1");

setCreativeTab(ModTabs.Tab1);

}

 

}

 

Now, in 1.10, the tabs still show up, but I cant add items to them! Anyone know what I'm doing wrong?

Lord Volkihar has requested that I send the following message to everyone who is gifted, intellectually or artistically:

We hope that some people could help us share an epic tale of lord Volkihar's achievements and magnificent life. we plan to do this through modern media such as books, games, and mods.

For lost details, we are looking for around 5 gallons of Cortexiphan, and some N.Z.T.(around 50 pills) also, if you happen to know how to create a gel with the same density as human flesh, but low viscosity and adhesion, recipes would be appreciated.

  • Author

That was just an example, I didn't actually plan on doing that.

 

 

@Mod(modid = MagicRifts.MODID, version = MagicRifts.VERSION)

public class MagicRifts {

public static final String MODID = "magicrifts";

public static final String VERSION = "0.0";

public static final String CLIENT_PROXY_CLASS = "com.zane49er.MagicRifts.proxy.ClientProxy";

public static final String SERVER_PROXY_CLASS = "com.zane49er.MagicRifts.proxy.ServerProxy";

 

@Instance

public static MagicRifts instance;

 

@SidedProxy(clientSide = CLIENT_PROXY_CLASS, serverSide = SERVER_PROXY_CLASS)

public static CommonProxy proxy;

 

@EventHandler

public void preInit(FMLPreInitializationEvent event) {

ModItems.init();

ModItems.register();

ModBlocks.init();

ModBlocks.register();

ModTabs.init();

ModWorld.init();

}

 

@EventHandler

public void init(FMLInitializationEvent event) {

proxy.init();

ModCrafting.register();

}

 

@EventHandler

public void postInit(FMLPostInitializationEvent event) {

 

}

}

 

 

Lord Volkihar has requested that I send the following message to everyone who is gifted, intellectually or artistically:

We hope that some people could help us share an epic tale of lord Volkihar's achievements and magnificent life. we plan to do this through modern media such as books, games, and mods.

For lost details, we are looking for around 5 gallons of Cortexiphan, and some N.Z.T.(around 50 pills) also, if you happen to know how to create a gel with the same density as human flesh, but low viscosity and adhesion, recipes would be appreciated.

When I create a Creative Tab for my mod I just have it has a variable in my main class like so

 

public class Main {
public static CreativeTabs tab = new CreativeTabs("tab") {
	public Item getTabIconItem () {
		return ModItems.AN_ITEM;
	}
};
}

 

I don't need it to place it in one of FML's initialization events.

 

Maybe try that and see if it fixes your problem.

 

When I create a Creative Tab for my mod I just have it has a variable in my main class like so

 

public class Main {
   public static CreativeTabs tab = new CreativeTabs("tab") {
      public Item getTabIconItem () {
         return ModItems.AN_ITEM;
      }
   };
}

 

I don't need it to place it in one of FML's initialization events.

 

Maybe try that and see if it fixes your problem.

 

 

Not having your creative tab defined in an anonymous inner class in your main class definitely isn't the problem.  Frankly I think having a creative tab in main in an anonymous inner class is messy and should be avoided...and as far as I can tell it was a trend started by tutorial writers.  Big surprise there.

 

 

And god forbid you want to start manually ordering your items/blocks, suddenly your creative tab's anonymous inner class is bigger than the rest of the main class several times over.

  • Author

diesieben07 is right, I was just initializing things in the wrong order, since I just initialized everything as I worked on it. Thanks, that would have taken a long time for me to notice.

Lord Volkihar has requested that I send the following message to everyone who is gifted, intellectually or artistically:

We hope that some people could help us share an epic tale of lord Volkihar's achievements and magnificent life. we plan to do this through modern media such as books, games, and mods.

For lost details, we are looking for around 5 gallons of Cortexiphan, and some N.Z.T.(around 50 pills) also, if you happen to know how to create a gel with the same density as human flesh, but low viscosity and adhesion, recipes would be appreciated.

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.