Jump to content

(1.16.5) [SOLVED] Unable to add an item to a creative tab or create custom tabs


Recommended Posts

Posted (edited)

Hey there, I've been searching everywhere for someone who's had a similar problem and decided I'll just ask. I've tried two different ways to get my registered item into the creative menu but neither have worked. For the first one I tried to add the item to an existing creative tab here: 

public class ItemInit {
	
	public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, 
			FlightRising.MOD_ID);
	
	public static final RegistryObject<Item> EARTH_EGG = ITEMS.register("unhatched_earth_egg", 
			() -> new Item(new Item.Properties().tab(ItemGroup.TAB_MISC)));

}

and I got this error log when I did so crash-2021-03-29_10.46.29-fml.txt

Secondly I tried making a set of custom creative tabs, copying the format from the ItemGroup class and making an abstract extending it for my own tabs. 

   public static abstract class FRItemGroup extends ItemGroup {
    	public static FRItemGroup[] FR_TABS = new FRItemGroup[3];
    	 public static final FRItemGroup FR_ITEM_TAB = new FRItemGroup(0, "fritemtab") {
    	@OnlyIn(Dist.CLIENT)
		public ItemStack makeIcon() {
			return ItemInit.EARTH_EGG.get().getDefaultInstance();
		}
    };
    public static final FRItemGroup FR_BLOCK_TAB = new FRItemGroup(1, "frblocktab") {
    	@OnlyIn(Dist.CLIENT)
    	public ItemStack makeIcon() {
    		return new ItemStack(Blocks.IRON_ORE);
    	}
    };
    public static final FRItemGroup FR_MOB_TAB = new FRItemGroup(2, "frmobtab") {
    	@OnlyIn(Dist.CLIENT)
    	public ItemStack makeIcon() {
    		return new ItemStack(Items.DRAGON_EGG);
    	}
    };
		public FRItemGroup(int i, String label) {
			super(label);
		}
		   @OnlyIn(Dist.CLIENT)
		   public abstract ItemStack makeIcon();
		}
    	
    }

which rewarded me with this crash-2021-03-29_19.39.00-fml.txt

The above is only one of several methods I've used to make creative tabs, both following tutorials and trying to go at it on my own. If anyone can figure out where I've messed up I'd greatly appreciate it. 

Edited by Jurassicash
Posted

what mappings are you using? you can check that in your build.gradle, look for mappings channel

if you recently updated forge or the mappings, try refreshing the gradle project

Posted
25 minutes ago, kiou.23 said:

what mappings are you using? you can check that in your build.gradle, look for mappings channel

if you recently updated forge or the mappings, try refreshing the gradle project

Mappings Channel says its using original, with version 1.16.5

Posted (edited)

Thank you both so much for your help!! I figured out I missed a crucial step in setting up my build.gradle and other associated files so when I cleared the cache, did the command prompts, and reloaded the whole project in eclipse everything worked like a charm. 

Edited by Jurassicash
  • Jurassicash changed the title to (1.16.5) [SOLVED] Unable to add an item to a creative tab or create custom tabs

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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