So i thought that putting in this code allows my custom mob,a Troll to spawn naturally in biomes.
EntityRegistry.registerModEntity(EntityTroll.class,"Troll", 2, this , 40, 3, true);
EntityRegistry.addSpawn(EntityTroll.class, 10, 1, 1, EnumCreatureType.creature, BiomeGenBase.beach, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.river, BiomeGenBase.swampland);
I added this in my main mod file.
So far it doesnt spawn naturally and I'm only able to spawn it from eggs in Creative mode. Any suggestions or ideas as to where the code is wrong?