Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

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.

  • 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.

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.