Jump to content

[1.18.1 Problem with GUI] Slot 4 not in valid range


Recommended Posts

Posted

--> First, I have to warn you, I am new to coding on java, so if you give me a solution, imagine that you are talking to a guy who has been only making texture packs and nothing else 😇

I just started this mod, following Nico Kaupenjohann's tutorial, and I want to add a new entity block that will have a UI, but every time I right-click on it, it opens up the interface, then 1s later, the game crashes and it reports me this error:

Caused by: java.lang.RuntimeException: Slot 4 not in valid range - [0,4)

I know that this error is due to the fact that my UI has 8 slots and the game somehow considers that there could be only 4, but after a good hour of searching, I couldn't find where the game considers it...

If you have any idea, here is the mod on github: https://github.com/AstronoCraft/RocketScienceMod/tree/master

Thank you in advance for any help!

Posted
6 hours ago, diesieben07 said:

Without having looked at your code (because you have not specified which inventory is the problem): Note that ItemStackHandler saves its size to disk. If you change the size later, it will keep the old size when loaded from disk.

Have you tried starting a new world?

Thank you it works now! 😅

Sorry I'm kinda dumb...

  • Like 1

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.