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'm trying to create a creative tab.

Also, I'd like to disclaim that I don't have a great amount of experience with Java, let alone modding with FML.

And that this is my first post, so please punish me gently.

 

Problem:

Unfortunately, I've come across an argument I am not familiar with. This is located within the main class. The only errors state that the arguments by TutorialTab is incorrect.

 

public static final TutorialTab tabTutorial = new TutorialTab(0, "tabTutorial");

 

Inside the argument, it requires me to put in an integer. ("0") When I do, run Minecraft, and attempt to open up my creative inventory, the client just crashes. I have already set up a CreativeTabs class:

package Epauchus.test;

import Epauchus.test.init.TutorialItems;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class TutorialTab extends CreativeTabs {

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

@Override
public Item getTabIconItem() {
	return TutorialItems.test_item;
}
}

If you see anything wrong and is capable of helping me fix it, please notify me. Your feedback will be greatly appreciated. c:

To further explain, each creative tab is supposed to have a unique id number (just a sequential int). That is what the first parameter means. If you use an id that is already used that will create trouble, so you need to find the next available one, which is what lars' recommendation does.

 

You'll find a similar thing in networking where each packet type needs to be registered with a unique id.

 

"Underneath the hood" of Minecraft the blocks, items and entities have unique ID numbers as well, but in recent versions of Forge that has been mostly hidden from any need to interact directly with them.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.