24 lines
677 B
Markdown
24 lines
677 B
Markdown
|
# 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
|
||
|
```java
|
||
|
import com.thebrokenrail.scriptcraft.core.ScriptCraftEntryPoint;
|
||
|
|
||
|
public class ExampleMod implements ScriptCraftEntryPoint {
|
||
|
@Override
|
||
|
public String getEntryPoint() {
|
||
|
return "example-mod";
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
```json
|
||
|
{
|
||
|
"entrypoints": {
|
||
|
"scriptcraft": [
|
||
|
"<Package>.ExampleMod"
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
This will run ```import `example-mod`;``` on initialization.
|