Jump to content

[1.7.2] Modifying NBT on client-side


Pardeep

Recommended Posts

I'm making a mod where, at the core, I want to edit custom variables of a player through a button on a gui, opened from right-clicking a block.

The only problem is in the GUI class there's no way to get the modification to happen on the server side (as far as I know).

Is there a way I can either:

1) Send a client->server packet for NBT, because as far as I know there isn't a PacketHandler method for sending to the server AND specifying which player gets it.

OR

2) Some way of changing the variables on the server side within the GUI, perhaps through other classes.

 

All help is appreciated. Thanks in advance.

Link to comment
Share on other sites

You will need to send Packets.

If you send a packet to the server, the server will know who send it and match it to the correct player.

So I tried your advice and it didn't work. The NBT data does not seem to be updating on the server side. Is there no way I can change the variable on the server side in the GUI?

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.