r/MinecraftModder • u/Morgrimm • Aug 18 '14
Here to help!
Hey guys, I've been modding Minecraft for a few years now, and I'm happy to help to the best of my ability (with code, answering questions, how MC works, etc.) I don't have any public mods at the moment, but I AM currently working on a Blood Magic addon :) Ask away!
4
Upvotes
View all comments
Show parent comment
1
u/Morgrimm Aug 21 '14
I haven't done this in awhile, and I can't think of the specific code offhand, but the general way I'd go about doing that is creating a container and inventory for the item, as well as a gui, and then adding a player.openGui call within the item's onRightClick method. In order to save inventory, you would actually save it in the item's NBT data (there's a method already provided that can write an itemstack to an NBT tag), but I can't remember exactly how. I'll replay back to this in a bit when I look into the specifics some more :)