Jump to content

Recommended Posts

Posted

Hey,

 

I'm trying to have it work so that on pressing a custom button in a gui that extends a GuiContainer the contents of the container gets modified. For example, I have it so that upon the button press, it calls a function in the TileEntity linked to the gui which copies the item stack in slot 0 and puts it in slot 1, and empties slot 0. It also adds additional NBT data to the stack. Unfortunately, when you try to take the new ItemStack out of slot 1, it resets to before you press the button, with the old stack in slot 0 with no additional data.

 

Does anyone know how to make it so that the client side and server side containers synchronise and have the same contents?

Posted

As you press your button you would need to send a custom packet to the server that does all those operations you want it to do. As it is a container all ItemStacks changes made on the server should automatically be synced to the client watching the GUI.

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.