Jump to content

[1.15] Synchronize inventories of all players in server


SonicScrew12

Recommended Posts

Hi there,

 

I’m fairly new to modding with Forge, and I want to create a mod that synchronizes every player’s inventories so that every player shares the same inventory.

 

I did some research and I believe the best way to do this would be to make a container on the server and use Container.detectAndSendChanges() to send a packet whenever a player’s inventory gets updated. I see that Container.detectAndSendChanges() sends the packet to all Container listeners, but how do I create a ContainerListener on the 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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.