Getting Started
Initial Setup
It’s pretty easy to get The Broken Script set up for development. Here’s a template to get you going:
repositories { // All your repositories are here, then add: maven("https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/") maven("https://maven.fzzyhmstrs.me/") maven("https://thedarkcolour.github.io/KotlinForForge/") maven("https://api.modrinth.com/maven") maven("https://maven.blamejared.com") maven("https://maven.stardustmodding.org/public-snapshots/")}
dependencies { implementation("dev.wendigodrip:thebrokenscript:1.9.9-beta.1+mc1.21.1-build.1")}
repositories { // All your repositories are here, then add: maven { url "https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/" } maven { url "https://maven.fzzyhmstrs.me/" } maven { url "https://thedarkcolour.github.io/KotlinForForge/" } maven { url "https://api.modrinth.com/maven" } maven { url "https://maven.blamejared.com" } maven { url "https://maven.stardustmodding.org/public-snapshots/" }}
dependencies { implementation("dev.wendigodrip:thebrokenscript:1.9.9-beta.1+mc1.21.1-build.1")}
Adding the Dependency
Make sure to add the mod as a dependency to your neoforge.mods.toml
!
[[dependencies.${mod_id}]] # If you don't use variable replacements, replace '${mod_id}' with your mod ID. modId = "thebrokenscript" type = "REQUIRED" versionRange = "[1.9.7,)" ordering = "AFTER" side = "BOTH"
Registries
The mod provides a convenient wrapper over many registries that makes the process of many things easier. Check out the RegistryWrapper class in the docs! To set this up, add this to your mod’s main class:
package com.example.mymod
import net.neoforged.fml.common.Modimport thedarkcolour.kotlinforforge.neoforge.forge.MOD_BUSimport dev.wendigodrip.thebrokenscript.api.registry.RegistryWrapper
@Mod(MyMod.MOD_ID)object MyMod { const val MOD_ID: String = "my_mod" val REGISTRAR = RegistryWrapper(MOD_ID)
init { // Your code here... // Maybe register some stuff! :)
REGISTRAR.setup(MOD_BUS) }}
package com.example.mymod;
import net.neoforged.fml.ModContainer;import net.neoforged.fml.common.Mod;import net.neoforged.bus.api.IEventBus;import dev.wendigodrip.thebrokenscript.api.registry.RegistryWrapper;
@Mod(MyMod.MOD_ID)public class MyMod { public static final String MOD_ID = "my_mod"; public static final RegistryWrapper REGISTRAR = new RegistryWrapper(MOD_ID);
public MyMod(IEventBus bus, ModContainer mod) { // Your code here... // Maybe register some stuff! :)
REGISTRAR.setup(bus); }}