Jump to content

[1.20] Help with custom creative tab textures


Guest

Recommended Posts

Hey there all, I have a very annoying problem.

Using Forge 1.20+ has broken one under-used, very specific feature.

I know for a fact that creative tabs have a 'background' texture and a 'tabs' texture. Since the start of 1.19 (and some other versions), I was using two textures for my mod that overwrite the vanilla 'tabs.png' and 'items.png' textures for my mod's tab. They worked flawlessly, until 1.20+.

The 'background' image still changes to the custom one, however, my code didn't seem flawed at all.

public static RegistryObject<CreativeModeTab> ALL_ITEMS_TAB_v2 = CMTS.register("thingamajigs",
            () -> CreativeModeTab.builder()
                    .icon(() -> new ItemStack(ThingamajigsItems.THINGAMAJIG.get()))
                    .title(Component.translatable("itemGroup.Thingamajigs"))
                    .withBackgroundLocation(new ResourceLocation("thingamajigs:textures/gui/thingamajigsitems.png"))
                    .withTabsImage(new ResourceLocation("thingamajigs:textures/gui/thingamajigstabs.png"))
                    .withTabsBefore(CreativeModeTabs.SPAWN_EGGS)
                    .build());

The specific line of code that used to work is:

.withTabsImage(new ResourceLocation("thingamajigs:textures/gui/thingamajigstabs.png"))

But this old method for the builder does not change the 'tabs' image anymore. It changes the tab's icon now according to the notes in the creative tab class.

What is the new method or way to change the 'tabs.png' image for creative mode tabs in 1.20+?

I cannot figure out how it is done, as the class for the creative tab doesn't have a single method that changes the 'tabs.png' image to a custom one, just the private variable 'tabsImage' being automatically set to the default one.

If it isn't possible anymore due to some vanilla change, then I guess I'll disable the background image.

Edited by CreativeMasterBonin
Link to comment
Share on other sites

  • Guest changed the title to [1.20] Help with custom creative tab textures

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.