Java API Setup
EmbersTextAPI publishes a jar for each loader and Minecraft version to a self-hosted Maven repository. Add the repository and the matching dependency to your mod’s build.gradle, and you can call the Java API directly from your own code.
repositories {
maven { url 'https://maven.tysontheember.dev' }
}
dependencies {
// pick the artifact matching your loader + Minecraft version:
// emberstextapi-fabric-1.20.1, emberstextapi-fabric-1.21.1, emberstextapi-fabric-26.1, emberstextapi-forge-1.20.1, emberstextapi-neoforge-1.21.1, emberstextapi-neoforge-26.1
implementation 'net.tysontheember.emberstextapi:emberstextapi-neoforge-1.21.1:3.0.0-beta.1'
} Browse every artifact and version in the Maven index → Requirements
Section titled “Requirements”Your Gradle toolchain must match the Java version used to compile ETA for the target you’re building against.
| MC version | Loader | Java |
|---|---|---|
| 1.20.1 | Forge | 17 |
| 1.20.1 | Fabric | 17 |
| 1.21.1 | NeoForge | 21 |
| 1.21.1 | Fabric | 21 |
| 26.1.x | NeoForge | 25 |
| 26.1.x | Fabric | 25 |
Add the Maven repository
Section titled “Add the Maven repository”repositories { maven { url = 'https://maven.tysontheember.dev' }}Add the dependency
Section titled “Add the dependency”Set eta_version in your gradle.properties to the version you want to pin to, then reference it in build.gradle.
gradle.properties
eta_version=3.0.0-beta.1dependencies { modImplementation "net.tysontheember.emberstextapi:emberstextapi-fabric-1.20.1:${eta_version}"}If you want ETA bundled inside your jar (so players don’t need to install it separately), add include alongside modImplementation:
include "net.tysontheember.emberstextapi:emberstextapi-fabric-1.20.1:${eta_version}"dependencies { modImplementation "net.tysontheember.emberstextapi:emberstextapi-fabric-1.21.1:${eta_version}"}dependencies { implementation "net.tysontheember.emberstextapi:emberstextapi-fabric-26.1:${eta_version}"}dependencies { implementation "net.tysontheember.emberstextapi:emberstextapi-neoforge-1.21.1:${eta_version}"}NeoForge artifacts use Mojang mappings natively, so no deobfuscation step is needed.
dependencies { implementation "net.tysontheember.emberstextapi:emberstextapi-neoforge-26.1:${eta_version}"}The published Forge jar is reobfuscated (SRG-mapped). Wrap it with fg.deobf() so ForgeGradle remaps it back to the names your code sees.
dependencies { implementation fg.deobf("net.tysontheember.emberstextapi:emberstextapi-forge-1.20.1:${eta_version}")}Project layout
Section titled “Project layout”In a typical multi-loader project, ETA belongs in your loader-specific subprojects, not in your common module (which can’t resolve Minecraft-specific types at compile time).
- build.gradle (root)
- gradle.properties (eta_version goes here)
Directorycommon-1.21.1/
Directorysrc/main/java/ (your shared logic, calls ETA via the API interface)
- …
Directoryfabric-1.21.1/
- build.gradle (modImplementation for ETA here)
Directorysrc/main/java/
- …
Directoryneoforge-1.21.1/
- build.gradle (implementation for ETA here)
Directorysrc/main/java/
- …
Verify the dependency resolved
Section titled “Verify the dependency resolved”After syncing your Gradle project, run the dependencies task for the subproject you added ETA to and grep for the artifact:
./gradlew :fabric-1.21.1:dependencies | grep emberstextapiExpected output (version will differ):
\--- net.tysontheember.emberstextapi:emberstextapi-fabric-1.21.1:3.0.0-beta.1./gradlew :neoforge-1.21.1:dependencies | grep emberstextapiExpected output:
\--- net.tysontheember.emberstextapi:emberstextapi-neoforge-1.21.1:3.0.0-beta.1cd forge-1.20.1 && ./gradlew dependencies | grep emberstextapiExpected output:
\--- net.tysontheember.emberstextapi:emberstextapi-forge-1.20.1:3.0.0-beta.1