Jump to content

Recommended Posts

Posted
1 hour ago, diesieben07 said:

Subscribe to PlayerContainerEvent.Open. Check for ChestContainer. If you detect it, replace it's Slots with a custom Slot implementation where canTakeStack returns false.

That's the server side done.

For the client subscribe to GuiOpenEvent, check for ChestScreen and do the same with the contained ChestContainer.

 

Note: Chests are special in that they are not tied to their tile entity very strongly in the container implementation. Servers that allow vanilla clients to connect will often use the "chest container" (which in the code is actually called "generic_9x6", there exists "generic_9x1" through "generic_9x6") for arbitrary inventories. There is no way to detect the difference.

okay, thank you :)

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.