Posted March 21, 201411 yr In an attempt to add a new value for EnumCreatureType, Minecraft crashed. The line adding the type is: public static final EnumCreatureType ambientWater = EnumHelper.addCreatureType("ambientWaterFish", EntityWaterMob.class, 40, Material.water, false); Here is a link to the Crash report: https://gist.github.com/Azaka7/9679277 I originally encountered this problem when modding for MC 1.6.4, and had hoped it was fixed for 1.7.2, but that's not the case. It's the same crash for both versions. I have been looking around the coding and I see no reason why this would cause a crash, but creating a custom armor material would not. It appears that Forge is feeding the constructor 2 unnecessary arguments. My reason to create this creature type is to be able to populate the ocean with very basic fish without spawn rates limited to that of squid and lobster (lobster is a water-type creature I've created). Does anyone know why this is happening? Do I need to do something different for custom creature types, or should I report this as a bug with Forge?
March 21, 201411 yr Actually, Forge is missing an argument (isAnimal). Just use this: private static final Class<?>[][] paramTypes = new Class[][] {{EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class, boolean.class}}; public static final EnumCreatureType ambientWater = EnumHelper.addEnum(paramTypes, EnumCreatureType.class, "ambientWaterFish", EntityWaterMob.class, 40, Material.water, false, true); instead of: public static final EnumCreatureType ambientWater = EnumHelper.addCreatureType("ambientWaterFish", EntityWaterMob.class, 40, Material.water, false); The last parameter, as previously suggested, means isAnimal. Set it to true/false accordingly Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
March 21, 201411 yr Author Oh, wow! Thank you very much. I guess I just didn't see that there were supposed to be two booleans.
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.