Jump to content

Recommended Posts

Posted

Hey everyone,

I want to do create a custom gui and when a player pressed a button that GUI will show up. How can I do that ? Is there a document or guide ?
I created key bindings.

Posted (edited)
7 hours ago, gbln00 said:

Hey everyone,

I want to do create a custom gui and when a player pressed a button that GUI will show up. How can I do that ? Is there a document or guide ?
I created key bindings.

Hi gbln00, welcome to the forums! Some of the best resources for modding are the forge documentation and vanilla classes. From the documentation, I would start at menus and then look at screens below that:

https://docs.minecraftforge.net/en/1.19.x/gui/menus/

Also:

https://docs.minecraftforge.net/en/1.19.x/misc/keymappings/

Since you're using keymappings, it sounds like the custom GUI you want is related to some type of settings menu. In that case, I would start by looking at a vanilla class such as OptionsScreen.class, found (in 1.20.1):

net.minecraft.client.gui.screens

The easiest way to navigate here is to type OptionsScreen somewhere in your mod, import it, and then middle click it.

Hope that helps.

Edited by urbanxx001
Posted
10 hours ago, urbanxx001 said:

Hi gbln00, welcome to the forums! Some of the best resources for modding are the forge documentation and vanilla classes. From the documentation, I would start at menus and then look at screens below that:

https://docs.minecraftforge.net/en/1.19.x/gui/menus/

Also:

https://docs.minecraftforge.net/en/1.19.x/misc/keymappings/

Since you're using keymappings, it sounds like the custom GUI you want is related to some type of settings menu. In that case, I would start by looking at a vanilla class such as OptionsScreen.class, found (in 1.20.1):

net.minecraft.client.gui.screens

The easiest way to navigate here is to type OptionsScreen somewhere in your mod, import it, and then middle click it.

Hope that helps.

Thank you for your help! I will look at it.

  • Like 1

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.