Runnable sample plugin and starter project for TitanClient's Java SDK.
This repository demonstrates:
@PluginDescriptormetadata.- Guice injection with
@Inject. - RuneLite-style config interfaces.
- Event subscriptions through
@Subscribe. - Direct
Clientaccessors such asclient.tick()andclient.localPlayer().
Copy or fork this repository for a new Java plugin. Then:
- Rename the
net.titan.samplepackage and classes. - Update
@PluginDescriptorwith your plugin ID, name, author, and version. - Update
SamplePluginConfigor replace it with your own config interface. - Change the output JAR name in
build.gradle.
- Java 11 or newer.
- TitanClient installed with the embedded Java runtime.
- A TitanClient account with the
feature.debug_modeentitlement.
The sample uses the published SDK dependency:
repositories {
maven { url = uri('https://raw.githubusercontent.com/Soxs/titan-public-sdk/main/maven/releases') }
mavenCentral()
}
compileOnly 'net.titan:titan-plugin-api:0.1.0'The sample already points at the public Titan SDK Maven repository. Pass
-PtitanMavenRepositoryUrl=... or set TITAN_MAVEN_REPOSITORY_URL only when
testing another repository.
For local SDK work, publish from the SDK checkout first:
cd path\to\titan-public-sdk\java
.\gradlew.bat publishToMavenLocalThis project checks Maven Local before remote repositories.
.\gradlew.bat clean buildThe plugin JAR is written to:
build\libs\titan-sample-plugin.jar
Edit the included gradle.properties file and set titanClientRoot to the
folder that directly contains controller.exe:
titanClientRoot=C:/Program Files/TitanClientThat TitanClient folder must include the embedded Java runtime at:
java/titan-java-embedded.jar
Then run either task:
.\gradlew.bat runViaTitanrunTitanClient/runViaTitan will also try common TitanClient install folders
and local source-build output folders if titanClientRoot is left blank.
You can still use a one-off Gradle property:
.\gradlew.bat runViaTitan "-PtitanClientRoot=C:\Program Files\TitanClient"Or set it for the current PowerShell session:
$env:TITAN_CLIENT_ROOT = "C:\Program Files\TitanClient"
.\gradlew.bat runViaTitanFor a local TitanClient source build, build controller first and use the
build output folder. Make sure Java runtime staging is enabled:
cmake -S . -B build -DTITAN_BUILD_JAVA_RUNTIME=ON
cmake --build build --config Release --target controller
.\gradlew.bat runViaTitan "-PtitanClientRoot=C:\path\to\SoxClientOSRS\build\controller\Release"runViaTitan is an alias for runTitanClient.
The task builds the sample, copies it to
%USERPROFILE%\.titanclient\plugins, and launches:
controller.exe --dev-mode --launch-new-client
Set TITAN_PLUGIN_DIR or pass -PtitanPluginDir=... to override the staging
directory.
net.titan.apiforClient,Player, andLogger.net.titan.api.pluginsforPluginandPluginDescriptor.net.titan.api.configfor config annotations.net.titan.api.eventsandnet.titan.api.eventbusfor subscriptions.