Jump to content

Sync Server-Client item stackTagCompound changes


zedblade

Recommended Posts

Hello,

 

I have an issue server side when i try to change the stackTagCompound of my item by a GUI.

 

From Item RightClick event I open the GUI:

 

par3EntityPlayer.openGui(mymod.instance, mymod.myGuiID, par2World, 0, 0, 0);

 

And from GUI I assign a name & an array to the stackTagCompound of my Item:

 

 

 

                int[] anArray = new int[3];

        anArray[0] = (int)player.posX;

        anArray[1] = (int)player.posY;

        anArray[2] = (int)player.posZ;

                itemstack.stackTagCompound.setString("Name_" + myname, myname);

                itemstack.stackTagCompound.setIntArray(myname, anArray);

 

 

 

Seems go all ok but when i read again the stackTagCompound data i found nothing!

 

I guess i need to send data to the server side but how?

 

Please help.

 

Link to comment
Share on other sites

Yes, i need to modify the stackTagCompound only when is pressed OK button on the GUI, now i know GUI = client but absolutely I need to ask to the player some informations to be stored into his item.

 

Then i need a sample to how send a package from GUI button action to server ...

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.