Jump to content

Need help displaying a gui on item right click


dhalek

Recommended Posts

Hello out there,

I'm trying to port a mod to 1.3.2 and having some trouble displaying a gui on right click of an item.

My solution so far looks like this:

public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player)
{
	if (!fIsServer)
	{
		ModLoader.getMinecraftInstance().displayGuiScreen(new GuiBookOfTeleportation(world, player));
	}
	return itemStack;

}

 

This is kind of working but behaves weirdly. I think the proper way to do this is putting some code into the client proxy method getClientGuiElement but that is never called. Do I have to register this somewhere?

I want to display a gui screen inherited from GuiScreen with some buttons and a GuiSlot showing some text.

How is this done properly?

 

Many thanks in advance,

dhalek

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.