Jump to content

2 problems with custom GUI


Recommended Posts

Hello everyone, I'm trying to make 2 GUIs and both of them have problems:


1) In this GUI I should be able to insert an item in the only slot of my item (headPhones). The problems are:

    1) I can't interact with the player inventory, in any way

    2) In the container slot there's the item that's in the 2nd slot of the player's hotbar, I don't know why.


Here are the classes I used:







2) This GUI should allow the player to manage Links (I'm making a radio mod), I have 2 textFields and some buttons. The problem is that I can't interact with the textFields, in any way, neither clicking them nor using "textfield.setText("Test Text");". I even tried using a variable to get the String that is inserted.


Here are the classed used:







Any help, clarifications, suggestions would be really appreciated, thanks.

"I an atom in the universe, a universe of atoms"-- Richard P. Feynman

Link to comment
Share on other sites

The reason nobody helps much on these inventory issues is that it is very involved to look through all the code.


2nd, people tend to use their own convention instead of following the tutorials which normally causes the error.


In your case, you didn't follow the tutorials at all.  Read them again and start over.  There will never be a way to interact with the players inventory if you have client only functionality defined.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

I think I see your problem, in your gui handler class you are returning null, rather than your container, in getServerGuiElement and returning the container rather than the gui in the getClientGuiElement.  You may have other issues but that is the only issues I see at first glance.

Link to comment
Share on other sites

I had the 2nd problem as well. You assigned the slot the players internal inventory. You need to assign it to the tile entity, which should be implementing IInventory. I didnt look through your code, but thats most likely the error.


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.

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.