This is an old revision of the document!


Creative Tabs

To define a custom creative tab, define a static final field as follows.

The first argument is the id of the new tab, which will be used to define the translation key. The second argument is the icon of the new tab, which is a supplier to a ItemStack instance.

1.19.3 to 1.19.4

public static final CreativeTabRegistry.TabSupplier MY_TAB = CreativeTabRegistry.create(
        new ResourceLocation(“modid”, "test_tab"), // Tab ID
        () -> new ItemStack(Items.STONE) // Icon
);

1.19.2 or below

public static final CreativeModeTab MY_TAB = CreativeTabsRegistry.create(
        new ResourceLocation("modid", "my_tab"), // Tab ID
        () -> new ItemStack(Items.STONE) // Icon
);