Posted March 18, 20232 yr 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 March 18, 20232 yr by Valenwar missing vital info
March 18, 20232 yr 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.
March 18, 20232 yr 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.
March 18, 20232 yr 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.