Jump to content

[1.16.5] How to sync slots in custom GUI?


RInventor7

Recommended Posts

Hi! I have created a custom TileEntity. The container has 1 slot and 1 button. I enter any item to that slot. If I press the button, it should play a sound and print out how many items are in the slot (if the slot is not empty). Doesn't matter which items/blocks I put into the slot or how many of them I put into the slot, after pressing the button the sound is NOT played and the count printed out is always 0. Why is that so? And how to fix this? Thanks. 

Edited by RInventor7
Link to comment
Share on other sites

There happened to be a few simple logic mistakes. I now get the correct sound out and a correct value is printed out on server

Edit: Client it is still 0 for some reason. Because the functions checking the item count in a slot ware running only on server.

Edited by RInventor7
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.