Jump to content

[HELP] Creating a GUI and Using it


b_meek

Recommended Posts

First off - Thank you to whoever decided to take pity on me and open this thread.

 

Secondly - I am brand new to modding and I'm just trying to figure out how to do Gui's, and how to open it via item.

I've created the item class, resource location class, the base mod class, the client and common proxies, all that good stuff. I have my item registered and it shows up properly in the game, so as for adding the item - I'm good to go.

What i can't for the life of me figure out, or find ANYWHERE on the internet, is how to set up,register/apply,and use a custom GUI. Would some one please help me. I will post any code requested to see, i just don't know what i should show so i will do it as we go.

 

I am using Forge 9.10 for Minecraft 1.6.2

 

and again, thank you very much

Link to comment
Share on other sites

To make the introduction easier for you I would suggest you try first at adding any kind of block with a custom GUI. There should be loads of tutorials for that out there ^^

 

That should teach you about GUI handlers and GUI's.

 

GUI handlers handle simply which container and which GUI to use and display when a player opens a GUI from your mod :)

 

For an item to open a GUI you make use of the onItemUse or itemRightClick methods (Names may be slightly off, they are from memory).

Inside that method you call upon the players openGUI method and pass inn the MainModClass.instance along with the GUI ID you assigned this GUI inside your GUI handler.

 

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

I tried to follow the container and GUI tutorial but i simply couldn't understand most of it. The tutorial is useless for someone who is trying to understand how to do things. All the tutorial does is show you the code of the different files it uses. It doesn't even explain where some bits of code are suppose to go. I am essentially back to ground 0 =(

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.

Announcements



×
×
  • Create New...

Important Information

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