Jump to content

[1.16.3] How to properly implement the config screen


nero!

Recommended Posts

Hey!

I use `ForgeConfigSpec`to configure my mod. I expected it to automatically generate the config screen (which is shown when clicking the "config" button of the mod), but it turns out that the developers are supposed to set up that screen. That's how it works at least for 1.12.x and older versions. However, I did not find any resources on how to do it for forge 1.13+. I looked at the documentation, public repos, forge forums but I could not find anything.

 

So my question is: How am I supposed to make that "config" button work? Because at the moment, the users of my mod need to manually edit their config file.

 

Thank you for your help!

Link to comment
Share on other sites

  • 2 weeks later...

Found a solution thanks to "Curle" on the forge discord.

 

ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY, () -> (mc, screen) -> {
    return new CustomOptionsGUI(screen);
});

 

Then you need to create your own config screen (since it is not yet implemented in the forge api)

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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