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

Hello,

I have a custom mod which, I have registered the renderer, egg and entity for natural spawning, however, I have yet to see it actually spawn.  I have it set in the same way as a vanilla mob (zombie).  (The egg and renderer works, just not natural spawn).

 

@EventHandler
public void init(FMLInitializationEvent event) {
        // get next available id
int mobId = 0;
        do {
            mobId++;
        } while(EntityList.getClassFromID(mobId) != null);

registerModEntityWithEgg(GhoulEntity.class, "Ghoul", mobId, 0x3F5505, 0x4E6414);
// register entities for natural spawn
EntityRegistry.addSpawn(GhoulEntity.class, 100, 4, 4, EnumCreatureType.MONSTER);

// register renderers
proxy.registerRenderers();
        }

  • Author

Sorry, I forgot to add my method:

@SuppressWarnings("unchecked")
private void registerModEntityWithEgg(@SuppressWarnings("rawtypes") Class entityClass, String entityName, int mobId, int primary, int secondary) {
    EntityRegistry.registerModEntity(entityClass, entityName, mobId, Mobs.instance, 80, 3, false);
    EntityRegistry.registerEgg(entityClass, primary, secondary);
}

 

I'm using the ID generated in the calling method.  I didn't see a method that doesn't take an ID.

  • Author

I originally was using a non-global ID, however, that didn't seem to work.

 

Since each mod has it's own ID space, then the code I was using wasn't incorrect, just simply unnecessary, and shouldn't be causing any issues.  I'll update it regardless as it doesn't make sense to keep (both the id selection and the helper method), but it doesn't solve the underlying issue.

  • Author

Thanks, that did the trick.  The weird thing is I had manually constructed an array with most of all the biomes but that didn't seem to work, so I removed it altogether because I thought if not provided, the default would be all biomes.  Looking at the code - obviously not - doh!  Don't know what I screwed up before, but this works.  Thanks again.

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.