Jump to content

ArrayIndexOutOfBoundsException when adding new EnumCreatureType


Recommended Posts

Posted

A user posted a crash log of the mod throwing an 

Caused by: java.lang.ArrayIndexOutOfBoundsException: 6

The full crash log can be found here: https://paste.dimdev.org/ziliruyota.mccrash

I followed the stack trace and cannot figure out why Biome.getSpawnableList() would throw an exception. The mod works fine on its own, but crashes with other mods that add entity spawns. This only happens when I use my own EnumCreatureType, which is for allowing the mod's entities to spawn without interfering with the animal spawn cap. I'm not sure why it throws an ArrayIndexOutOfBoundsException since getSpawnableList() creates a new, empty ArrayList for non-vanilla EnumCreatureTypes, and I'm not sure why it's 6 in particular. In case it's needed, I call initEntities() during preinit and addSpawns() during init.

 

Here's my entity code:

  Reveal hidden contents

And here's both Biome.getSpawnableList() as well as EntityRegistry.addSpawn() for reference.

  Reveal hidden contents
  Reveal hidden contents

 

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.