Jump to content

Recommended Posts

Posted (edited)

Hello!

I am a pretty new modder so I am not too familiar with how this works at all so I am learning as I go. 

 

Right now I am trying to create an item that opens a custom GUI/menu when I right click it. Right now I have the item and the sprite, I know how to do the use command to detect if I am right clicking in game. All I need to do is create the GUI/Menu, I have been looking for help for a couple of days now and I just am not understanding what I should be doing. Any help would be appreciated.

Edited by ThatGuyWasMe
Typo
Posted
  On 2/15/2022 at 12:14 AM, ThatGuyWasMe said:

Hello!

I am a pretty new modder so I am not too familiar with how this works at all so I am learning as I go. 

 

Right now I am trying to create an item that opens a custom GUI/menu when I right click it. Right now I have the item and the sprite, I know how to do the use command to detect if I am right clicking in game. All I need to do is create the GUI/Menu, I have been looking for help for a couple of days now and I just am not understanding what I should be doing. Any help would be appreciated.

Expand  

You need to extend the Screen class (see PauseScreen for example). Override the rendering method to add your extra things. You can also call the addRenderableWidget method to add controls (buttons, for example). Then see how e.g books do it to open the screen. You can also use the Minecraft#setScreen method if you want to display the screen using something else. 

Posted
  On 2/15/2022 at 9:00 AM, matthew123 said:

You need to extend the Screen class (see PauseScreen for example). Override the rendering method to add your extra things. You can also call the addRenderableWidget method to add controls (buttons, for example). Then see how e.g books do it to open the screen. You can also use the Minecraft#setScreen method if you want to display the screen using something else. 

Expand  

When you are referring to looking at things for examples (PauseScreen and books), how would I go about doing that? I am using Eclipse for the modding.

Posted
  On 2/16/2022 at 3:58 AM, ThatGuyWasMe said:

When you are referring to looking at things for examples (PauseScreen and books), how would I go about doing that? I am using Eclipse for the modding.

Expand  

Navigate to the definition of the screen class. Also, Eclipse is not a good IDE, use IDEA Community Edition. With IDEA, you can CTRL+Click on a class and see the definition.

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.