b_meek Posted August 5, 2013 Share Posted August 5, 2013 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 Quote Link to comment Share on other sites More sharing options...
Mazetar Posted August 5, 2013 Share Posted August 5, 2013 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. Quote If you guys dont get it.. then well ya.. try harder... Link to comment Share on other sites More sharing options...
b_meek Posted August 5, 2013 Author Share Posted August 5, 2013 ok, that makes sense. Could you by any chance direct me to a good tutorial on how to do so. the GUI/container tutorial on the Forge forums is out-dated. thanks for the help Quote Link to comment Share on other sites More sharing options...
GotoLink Posted August 5, 2013 Share Posted August 5, 2013 The tutorial may be outdated, but it may work anyway Quote Link to comment Share on other sites More sharing options...
b_meek Posted August 5, 2013 Author Share Posted August 5, 2013 alright. ill take a look around. Let you guys know how trying work out. thanks a bunch for helping out Quote Link to comment Share on other sites More sharing options...
b_meek Posted August 5, 2013 Author Share Posted August 5, 2013 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 =( Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.