๐Create a mod
There are two options: create from mod template or from empty folder.
Create from mod template
If you know how to use git and have SSH Key configured on Github, just execute the command under GAMEPATH/Mods
git clone git@github.com:WorldBoxOpenMods/ModTemplate.git <ModName>Otherwise, download ModTemplate, and unzipped it under the folder GAMEPATH/Mods.
Then your folder structure should be like this. Pay attention to directory.

There are several files neccessary to modify
mod.jsonModify value of "name" to mod name, "author" to author name. "GUID" to global unique ID of your mod(Determine the ID by yourself to avoid collision with other mods)ModClass.csModify "CHANGEME" to your mod's namespace, and avoid collision with other mods
Then initialize your mod in OnModLoad in file ModClass.cs. BasicMod inherits from MonoBehaviour, you can implement other methods of MonoBehaviour like Update.
Create from empty folder
Create folder
Create a folder under GAMEPATH/Mods, create such two files mod.json and Main.cs like below.
If you use IDE, you should create a .Net Framework4.8 project under GAMEPATH/Mods and then create the two files mod.json and Main.cs below. You can create the project through IDE or write it manually refer to Configure your IDE manually
Configure IDE
Add references to your project. Or you can find the .csproj example in ExampleMod.csproj(DO NOT COPY ALL DIRECTLY. YOU SHOULD DISTINGUISH WHAT IS USABLE)
Load your mod
You have made a simplest mod now. Launch WorldBox now.
If there are no problems above, you can find this in console:
And you can also find your mod in "Mods" window provided by NML.
Last updated