Java
Preparing for SDN
Java · Updated 09 November 2026
What a Script Market JAR must contain, and how to submit it.
Java scripts can be published through the Script Market today. Read What SDN is first if you are new to it. This page covers what your JAR needs and how to submit it.
The checklist
- Both registrations. Your JAR needs
module-info.classwith aprovides com.botwithus.bot.api.BotScript with ...clause and aMETA-INF/services/com.botwithus.bot.api.BotScriptfile that lists the same classes. A JAR that works locally with onlymodule-infocan still fail in the Script Market. See Project setup. - The API is never bundled. Declare
com.botwithus:bot-apiascompileOnly. The same goes for ImGui. The host provides both, along with SLF4J. Do not bundle a library the host already provides, such as Gson: the script then fails to load. - Pack your own libraries inside the JAR. Anything else your script uses at runtime, such as a helper library or code from another of your modules, has to be inside your JAR. Nothing else is installed next to it.
- Bump the version for every release. Change
versionin@ScriptManifesteach time you upload a new build, so you and your users can tell builds apart. - Do not sign anything. Protecting a published script is done by the server and the BotWithUs software, not by you. Upload the plain JAR your build produces.
Packing libraries
One way to merge your runtime dependencies into the JAR is to unpack them into it in the jar task. Because the API and ImGui are compileOnly, they are not on the runtime classpath and are left out:
tasks.jar {
from(configurations.runtimeClasspath.map { files -> files.map { zipTree(it) } }) {
exclude("module-info.class")
exclude("META-INF/MANIFEST.MF")
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
A library merged this way is no longer a module of its own, so in module-info.java you requires static it rather than requires it.
Check the result with the JDK's jar tool. List the files to see that every package you bundled is inside:
jar tf build/libs/my-script.jar
Then describe the module and check that provides names your script classes:
jar --describe-module --file build/libs/my-script.jar
The contains line there lists only your own packages, even when the bundled ones are inside, so use jar tf for those.
Submitting
- Open Script Market → New Marketplace Submission (
/sdn/submit/). You need an active BotWithUs subscription. - Fill in the form:
-
Name: unique across the Script Market.
-
Tagline: up to 54 characters, shown in listings.
-
Description and Usage Guide: both Markdown. Explain what the script does, what it needs, and how to set it up.
-
Category and Script Language: choose Java (Kotlin scripts count as Java).
-
Agent support: tick at least one. Scripts written against the API in this wiki are for Agent v2.
-
Repository and Repository Token (optional): a link to your source, and a token if that repository is private.
-
Private Script: only you and the users you add by hand can use it.
-
Pricing: a price for each duration you want to offer, from free to yearly.
- Submit. The BotWithUs team reviews new scripts before they are listed.
- Upload builds from your script's Versions page: choose the agent version, pick the JAR, and add notes for your users. Each new build goes through the same page.