Jump to content

Recommended Posts

Posted

I am stuck in working on blocks with custom containers, cuz everything works, storing items and stuff, but i can't drag and drop items and every time i click on the last six slots of the player inventory, game crashes. Java says arrayIndexOutOfBoundsException, but all values that could be causing it are either copy paste from mc (like adding playerslots to the inventory) or coded with a tutorial, i hope somebody can help me cuz it really slows down my work on the mod :(

 

My Custom Container class:

 

  Reveal hidden contents

 

 

My Custom TileEntity class:

 

  Reveal hidden contents

 

 

My custom Gui class

 

  Reveal hidden contents

 

 

 

Posted
  On 5/1/2015 at 4:55 PM, N247S said:

Could you please lost the crash logg? Most of the time its pointing directly to the problem.

 

Here is the errorlog:

 

  Reveal hidden contents

 

Posted

Okay, first of all you should clean up all those missing texture errors.

 

Anyway, the actual crash says exactly what is wrong -- you're trying to access slot 50 when it thinks there are only 45 slots. You need to look through the math to see how that is happening.

 

For how to implement the IGuiHandler, you might want to read my tutorial on container blocks: http://jabelarminecraft.blogspot.com/p/minecraft-modding-containers.html

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
  On 5/1/2015 at 6:07 PM, ItsAMysteriousOfficial said:

I know that it tries to access that slot, but the slot is in the inventory of the player and not in my custom slots anyway, ill try this guiHandlerstuff now :D

 

There are not 50 slots in the player inventory. There is 27 inventory slots plus 9 hotbar slots = 36.

 

You need to look at why your index is getting up to 50.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.