Jump to content

Packet handler


Mightydanp

Recommended Posts

Forge's documentation has a section on networking here. This includes the Simple Network Implementation, which you should use to send your packets.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Send a packet to the appropriate side with the necessary information and then open a GUI from your packet handler.

 

Are you sure you need to send a packet? What type of GUI is this and where are you opening it from?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Where are you trying to open it from?

 

If it's on the server (e.g. when the player right clicks a block/item), just call

EntityPlayer#openGUI

directly and FML will send a packet to the client telling it to open the same GUI.

 

If it's on the client (e.g. when the player presses a key), send a packet to the server and then call

EntityPlayer#openGUI

in the handler.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.