Jump to content

Recommended Posts

Posted (edited)

I've implemented a custom survival inventory with a custom itemhandler, with the end goal being something like this: The player's inventory has different tabs for different categories of items, like the creative tab, except each tab would be its own container and be able to keep track of item stacks. One for swords, tools food, etc. Most importantly, there is a "General" tab for misc items, but also so that the player inventory can still interact with crafting tables, furnaces, etc without breaking the vanilla containers. 

 

The problem I've run into so far is when adding slots for the various containers, I'm not sure how I should be handling the player hotbar. It obviously needs to be tied to the default player inventory with 3x9 slots, but I don't know how I should be handling that vs the custom inventory. Currently when I pick up items, it goes straight to the default inventory even though it's canceled.

 

Edited by Turtledove
Posted (edited)
21 minutes ago, diesieben07 said:

Subscribe to EntityItemPickupEvent, cancel it and then do your own pick-up processing.

Would you recommend taking items from the default inventory out from within the itemhandler or container instead? As in, after a player picks up an item, have it appear first in the default inventory, and if it fits within a certain category, it will move to another container.

 

This way, if a player is using a vanilla furnace or crafting table and needs to place recipe items into the default inventory, they can do so.

Edited by Turtledove

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.