Jump to content

Custom Container Difficulties


Zetal

Recommended Posts

Hey guys,

 

At the moment, I'm attempting to create a custom container. It SHOULD be showing the following:

 

The players inventory, the quick bar, and the 'bank' inventory.

 

I have everything working to a certain degree, but I'm having difficulties with the slotIndex values. The problem really stems from the fact that I just don't completely understand the purpose of them, or how they achieve that purpose. I tried to decipher it by looking at the other containers/slots, but I just don't understand it. Could someone help explain, please?

 

Thank you!

Have a modding question? PM me and hopefully I'll be able to help. Good at 2d Pixel Art? We need your help!  http://www.minecraftforum.net/topic/1806355-looking-for-2d-pixel-artist/

Link to comment
Share on other sites

The slot index corresponds to the slot of an ItemStack array that you should have created in your TileEntity. All of the IInventory implemented methods should point to that array.

 

It basically maps out so that each slot in a GUI lines up with a slot in that array. So you put something in the slot that you designated slot 0 in your Container, it will go in 0 slot of the array inside the TileEntity and you can reference it from there.

Link to comment
Share on other sites

Hi Denoflions,

 

Thanks for the help! I moved on to getting the GUI to work properly. For this storage item, I'd like to have the sidebar scrolling available, like in the creative inventory, but I can't even find where this is created. How is that done?

 

Thanks,

Zetal

Have a modding question? PM me and hopefully I'll be able to help. Good at 2d Pixel Art? We need your help!  http://www.minecraftforum.net/topic/1806355-looking-for-2d-pixel-artist/

Link to comment
Share on other sites

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.