Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • Author
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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.