Posted March 13, 20169 yr 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(); }
March 13, 20169 yr 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.
March 14, 20169 yr 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.
March 14, 20169 yr 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.