Skip to content

Mod outline

Peter Crew edited this page Jan 31, 2018 · 1 revision

It is strongly recommended for most mods (excluding more complex ones) to follow a basic pattern, each mod directory containing only one mod definition in a JavaScript file.


Mods are registered with Equilimod by using the aptly named ModRegistry class, which currently only contains one method that should be used: registerMod. This takes a Mod object as an argument and adds it to the internal mod list, loading it when Equilinox reaches the correct stage.

A very basic mod outline looks a little like this:

// this registers the mod object with the internal mod registry
ModRegistry.registerMod(new Mod({
   // the user friendly name of the mod (localisation is not currently supported)
   name : "Demo Mod",
   // the version of the mod (this MUST follow the semantic versioning standard)
   version : "1.0.0-beta",
   // the author responsible for creating the mod
   author : "pcr3w",
   // a brief description of the mod, to be displayed in the mods tab
   description : "An example outline of a mod!",

   // this function is called to load the mod's contents, containing all of the entity definitions, etc
   init : function() {
      // mod initiation goes here
   }
});

It is important to note that the mod version must follow the Semantic Versioning standard.

Clone this wiki locally