World Generation Loader

A mod that loads JavaScript world generators for minecraft.

Getting Started

World Generation Loader is a mod that loads JavaScript world generators  for minecraft.  These generators can be customized to their creators delight.  To get started run forge with the mod once so the necessary folder can be created.  Then just drop the '.gen' file into your '.minecraft\generators\' and access them in-game like any other world generators.

Notes

  • This is in very early alpha and may have bugs.
  • This has only been tested with Java 8 and will most likely not work on previous versions of java.  I am working on finding a way around this but it may take some time.  The reason behind in not working is stated in 'The basics of creating generators'
  • A full tutorial on how to make generators will be released shortly after I conclude whether I can get the mod to work with Java 7.
  • If you have any requests for features please do suggest them! I'd love to take the community into consideration when working on future updates.
  • You may use this mod in you mod pack at anytime so long as you link back to this page and give credit.
  • If you use this mod in a mod pack I would appreciate it if you messaged me about it but it is not necessary for you to do so.

The basics of creating generators

Before I can explain the basics of creating a generator I must first explain how generators work.  Generators are written in JavaScript and executed via the Oracle Nashorn JavaScript engine which is included in Java 8.  This is more optimized and quicker then other options so it was my first choice.  So enough about how it work you came to this section to learn to make generators.  To begin you should install a program such as notepad++ although NotePad should work as well. With your program of choice create a new blank text file and save it with the extension '.gen'. This right now is a basic generation file but if you were to run this your game would crash.  This is because you do not have the needed functions and variables.  For this example I will teach you how to create a void world.  To begin add the following code to the top of your '.gen' file:
var customPopulate = false;
var customStructures = false;
var customBiomes = false;
These are the generator settings and state whether your generator uses certain functionality.  At the moment they state that you will be using default population, structures, and biomes.  Next you must add your function that generates blocks just below your settings:
var generate = function(x, z, blockx, blocky, blockz, perlin, biome) {
 
return "air";
};
This method returns the block id that will be placed at the block coordinates that are passed in(blockx, blocky, blockz).  It also passes the chunk coordinates, a perlin noise, and another perlin noise that should be used when decided what biome should go where.  If you load this now you will see a world filled with air with random biomes scattered about.  This is caused by setting 'customBiomes' to false at the beginning of the file.  Setting it to false tells the generators to ignore your biome functions and use default minecraft's.  To fix this set the variable to false and add this code below your generate function:
var setBiome = function(x, z, blockx, blockz, perlin, biome) {

return 127;
}

 In this function we set the biome id at every x, z coordinate to 127 which is the id for void.  A list of biome ids can be found here.  If you run your generator now you should see a world filled with air and the void biome.

The World Generation Loader Team

profile avatar
Owner
  • 1
    Projects
  • 5.7K
    Downloads