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.10.0-beta.1+mc1.21.1-build.2")
// These are needed so you can use TBS APIs properly. // Even if you aren't using Kotlin, you need to have KFF as a dependency unless you want compiler errors. implementation("software.bernie.geckolib:geckolib-neoforge-1.21.1:4.7.3") implementation("me.fzzyhmstrs:fzzy_config:0.6.9+1.21+neoforge") implementation("thedarkcolour:kotlinforforge-neoforge:5.7.0") implementation("com.tterrag.registrate:Registrate:MC1.21-1.3.0+67")}
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.10.0-beta.1+mc1.21.1-build.2")
// These are needed so you can use TBS APIs properly. // Even if you aren't using Kotlin, you need to have KFF as a dependency unless you want compiler errors. implementation("software.bernie.geckolib:geckolib-neoforge-1.21.1:4.7.3") implementation("me.fzzyhmstrs:fzzy_config:0.6.9+1.21+neoforge") implementation("thedarkcolour:kotlinforforge-neoforge:5.7.0") implementation("com.tterrag.registrate:Registrate:MC1.21-1.3.0+67")}
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 ExtendedRegistrate 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.ExtendedRegistrate
@Mod(MyMod.MOD_ID)object MyMod { const val MOD_ID: String = "my_mod" val REGISTRAR = ExtendedRegistrate.create(MOD_ID)
init { REGISTRAR.registerEventListeners(MOD_BUS)
// Your code here... // Maybe register some stuff! :) }}
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.ExtendedRegistrate;
@Mod(MyMod.MOD_ID)public class MyMod { public static final String MOD_ID = "my_mod"; public static final ExtendedRegistrate<?> REGISTRAR = ExtendedRegistrate.Companion.create(MOD_ID);
public MyMod(IEventBus bus, ModContainer mod) { REGISTRAR.registerEventListeners(bus);
// Your code here... // Maybe register some stuff! :) }}