Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Why is my GUI Crashing?


  • Please log in to reply
5 replies to this topic

#1

Country_Gamer

Posted 07 February 2013 - 11:38 PM

I have a gui, with a button which teleports the player.
But everytime i press the button, the game crashes.
Error:
Spoiler:

Code:
Spoiler:

Posted Image

Register or log in to remove.

#2

ibbignerd

Posted 08 February 2013 - 05:54 AM

I believe your problem is below. The mouseClicked function gets the x and y coords of your mouse not in game. Try commenting those out.

 TeleportX.mouseClicked(i, j, k);
 TeleportY.mouseClicked(i, j, k);
 TeleportZ.mouseClicked(i, j, k);


#3

Country_Gamer

Posted 08 February 2013 - 11:57 AM

Ill try it when i go to code, but as i recall, the button doesnt refer currently to the text fields. It is only calling the method "entityplayer.setPosition(100, 100, 100);"
Posted Image

#4

wuffelleffuw
  • Minecraft: WuffelleffuW

Posted 08 February 2013 - 01:38 PM

A TARDIS, huh? Me likes already. Posted Image

Your textfields aren't getting initialized, that's why they're throwing NullPointers. Just add
TeleportX = new GuiTextField(fontRenderer, X, Y, Length, Heigth);
for each of your textfields to the initGui()-method, of course with the needed arguments.

#5

Country_Gamer

Posted 08 February 2013 - 05:06 PM

View Postwuffelleffuw, on 08 February 2013 - 01:38 PM, said:

A TARDIS, huh? Me likes already. Posted Image

Your textfields aren't getting initialized, that's why they're throwing NullPointers. Just add
TeleportX = new GuiTextField(fontRenderer, X, Y, Length, Heigth);
for each of your textfields to the initGui()-method, of course with the needed arguments.
Thanks! That fixed the crashing problem!
Now i just have to fix a button issue, re-add all the gui stuff, and work out any bugs from there! Thanks again!
(link to new bug(in actionPerformed) http://www.minecraft...ctionperformed/)
Posted Image

#6

Country_Gamer

Posted 09 February 2013 - 04:02 PM

I any of you are interested, this is the link to where my mod will be:
http://www.minecraft.../#entry20722555
Posted Image