-
Notifications
You must be signed in to change notification settings - Fork 7
Intro: JMX for Mod Developers
Mod Developers can use JMX to create enhanced models for modded blocks and items using the same workflow as for vanilla Minecraft models.
Add my maven repo to your build.gradle
repositories {
maven {
name = "grondag"
url = "https://grondag-repo.appspot.com"
credentials {
username "guest"
password ""
}
}
}And add JMX and FREX to your dependencies
dependencies {
// optional dev env annotation support
compileOnly "org.apiguardian:apiguardian-api:1.0.0"
compileOnly "com.google.code.findbugs:jsr305:3.0.2"
modImplementation ("grondag:jmx-${project.mc_tag}:${project.jmx_version}.+") { transitive = false}
// remove next line if you want JMX to be an optional dependency
include "grondag:jmx-${project.mc_tag}:${project.jmx_version}.+"
}JMX is built for specific Minecraft versions, indicated by mc_tag. Minecraft 1.15.x has tag mc115.
Consult the gradle.properties file for the latest major.minor version numbers.
If your JSON model files include all attributes necessary for vanilla models, then JMX can be an optional dependency for your mod. (Of course, your models will not have enhanced features unless JMX is present.)
To make JMX optional, implement grondag.jmx.api.JmxInitializer on a class that is not referenced from any code that will run when JMX is absent. Then add that class name as a jmx entry point in your fabric.mod.json file. See the comments on JmxInitializer for more information.