Skip to content
CleverNucleus edited this page Jul 12, 2021 · 28 revisions

Developer Wiki

This wiki is here to provide an advanced guide to integrating the PlayerEx API with your mod.

A note of caution: a relatively high level of java competency is expected, so if you have come here after watching your first insert generic modding tutorial, this may not be appropriate.

Setting Up The Build

You can integrate the PlayerEx API using Gradle. In your mods build.gradle file, the following must be present:

dependencies {
    modRuntime "com.github.CleverNucleus:PlayerEx:${version}"
    modImplementation "com.github.CleverNucleus:PlayerEx:${version}:api"
}

Replace ${version} with the PlayerEx version - 2.0.4 for example. This puts PlayerEx in the runtime and will bundle the API with your build. PlayerEx includes jar-in-jar dependencies of Cardinal Components Base and Entity packages, Reach Entity Attributes, Cloth Config API, Step Height Entity Attribute and TooltipFix.

dependencies {
    modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}

As of PlayerEx version 2.0.1 this is a Fabric mod, and has an external dependency for the Fabric API, so you must also compile that into the runtime.

repositories {
    maven {
        name = 'Ladysnake Mods'
        url = 'https://ladysnake.jfrog.io/artifactory/mods'
    }
    maven {
        url "https://maven.jamieswhiteshirt.com/libs-release"
        content {
            includeGroup "com.jamieswhiteshirt"
        }
    }
    maven {
        url "https://maven.shedaniel.me/"
    }
    maven {
		url "https://maven.terraformersmc.com/"
	}
    maven {
        url "https://www.cursemaven.com"
    }
    maven {
        url "https://jitpack.io/"
    }
}

Since PlayerEx has dependencies (jar-in-jar), you must include the above maven repositories; when you build your gradle project the required mods will be included. At the moment, the only online maven-structured repository is with jitpack, however with time alternatives may become available.

After building the project and refreshing dependencies the API will become available in the developer environment. The API contains javadocs for eclipse users.