Use the CreativeModeTabEvent.Register
event to register your tab, the items will appear in the order you declare them.
The accept method has an optional parameter to specify if the items also appear in the search tab or not. Defaults to appearing in both.
public static CreativeModeTab MY_TAB;
private void registerTabs(CreativeModeTabEvent.Register event)
{
MY_TAB = event.registerCreativeModeTab(new ResourceLocation(MODID, "main_tab"), builder -> builder