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 am currently trying to make a simple object, with no special rules, that lets you right click it, and open a chest like inventory.

After several days of looking around, viewing published sources from a few different mods and bouncing around the Forum looking for help, I have made zero progress. I believe I have the basic knowledge expected, but this task is seriously making me wonder. Help is wanted desperately. I am working in 1.19.2.

 

Edited by Valenwar
missing vital info

It's not something I have ever done myself.

I've done it with BlockItems like Shulker boxes, but that's different because vanilla has special handling for BlockEntity data stored in BlockItems.

 

I would suggest finding a mod that does something similar to what you want? e.g.

https://github.com/P3pp3rF1y/SophisticatedBackpacks/blob/cab406e07d10563f6fa648c1882dfad0ddde8cfd/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackItem.java#L284
The most important methods will be:

Item.use() -> opens the gui menu
Item.initCapabilities() -> adds an ItemHandlerCapability to the item's ItemStacks, i.e. an inventory

There is obviously more to it than this, but these are the basic entry points you can start from.

Maybe you can find a simpler example than sophisticated backpacks? 🙂

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

  • Author

Thank you, I've looked into their mod source before, but the important methods helps. It is easy to get overwhelmed by an excess of information. 

 

  • Author

For future reference to anyone else attempting this, the BundleItem might be a good place to start, it doesnt have a chest UI, but it does store items within.

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.