This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
ScriptCraft/docs/ENTRY_POINTS.md
TheBrokenRail 37f11a92f0
All checks were successful
ScriptCraft/pipeline/head This commit looks good
Add Documentation
2020-05-24 14:09:25 -04:00

677 B

Entry-Points

To add an entry-point to your mod create a class implementing ScriptCraftEntryPoint and override the method getEntryPoint() to return your entry-point. Then, add your new class to the scriptcraft entry-point in fabric.mod.json.

Example

import com.thebrokenrail.scriptcraft.core.ScriptCraftEntryPoint;

public class ExampleMod implements ScriptCraftEntryPoint {
    @Override
    public String getEntryPoint() {
        return "example-mod";
    }
}
{
    "entrypoints": {
        "scriptcraft": [
            "<Package>.ExampleMod"
        ]
    }
}

This will run import `example-mod`; on initialization.