Jump to content

[1.7.10] Open GUI On GUI Button Click


Bugzoo

Recommended Posts

I know this is a pretty nooby question, but how would I do it, here is my code

 

if(guibutton.id==12){
		authenticatePin(enteredPin);
	}
}

private void authenticatePin (String pinCode) {
	EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    	if (pinCode.equals(ItemDebitCard.checkCardPin(player))) {
    			System.out.println("Correct Pin!");
    			player.openGui(FinancialMod.instance, 1, world, x, y, z)
    		} else {
    			System.out.println("They Dont MATCH!");
    		}
}

Link to comment
Share on other sites

I can't be sure about this as I've never played around with GUI elements before (something I'm about to get into). Have you tried calling FMLNetworkHandler.openGui() from the button click listener though?

 

EDIT: I didn't really look though your code. Interesting that we both have different GUI calling methods. You'll probably have to find a way to close your current GUI, which I don't know how to do, so I'll shut up now...

I have no idea what I'm doing.

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.