TesterTesting135 Posted August 21, 2019 Share Posted August 21, 2019 Hello, so I have made an item that has a GUI. I want the gui to save the data i have typed in a text box to the Item. However, I cannot get this to work properly. I believe I have to use packets. How would i got about this? Quote Link to comment Share on other sites More sharing options...
eatthenight Posted August 21, 2019 Share Posted August 21, 2019 (edited) you could e.g send a packet to the server when you close the gui or press a button. the server will handle the message do something (or not) and will then (if it was succesful) send a packet back to the client. this is important to prevent cheating and stuff all changes should be made on the server and then synced with the client. for packets look up SimpleNetworkWrapper: https://mcforge.readthedocs.io/en/latest/networking/simpleimpl/ you have to send a packet to the server with the data -> server checks the data, if its valid -> do something -> send a packet back to the client to update the data in the packets you send the data and in the handler you decide what happens with that data Edited August 21, 2019 by eatthenight Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.