Getting Started
Add Strata as a dependency, declare it, and reach the API.
Strata is installed once on the server and your plugin depends on it, the same model as Vault,
LuckPerms, or PlaceholderAPI. You compile against the thin strata-api artifact and call into the
running Strata plugin at runtime.
1. Install the server plugin
Download strata-<version>.jar from the GitHub releases
and drop it in /plugins. The heavy runtime libraries (Kotlin stdlib, coroutines, Exposed, HikariCP,
JDBC drivers) are downloaded automatically by Paper's library loader on first start, so server owners
install nothing else.
2. Depend on the API
Add the alazso Maven repository and the strata-api artifact (compile-time only).
repositories {
maven("https://repo.alaz.so/releases") { name = "alazso" }
}
dependencies {
compileOnly("so.alaz.strata:strata-api:0.1.0")
}You ship no kotlin-stdlib of your own, because it resolves at runtime through Strata's
classloader.
3. Declare the dependency
Strata loads at the STARTUP phase, so declare it as a required server dependency that loads first.
dependencies:
server:
Strata:
load: BEFORE
required: true4. Use the API
Everything is reached through StrataApi. It's available once Strata has enabled, which your
BEFORE/required dependency guarantees.
import so.alaz.strata.api.StrataApi;
import so.alaz.strata.api.hook.EconomyHook;
public final class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
// Folia-safe scheduling, bound to your plugin:
StrataApi.scheduler(this).async(() -> getLogger().info("off-thread work"));
// Best-available economy provider, or null if none is installed:
EconomyHook eco = StrataApi.hooks().get(EconomyHook.class);
}
}StrataApi.isAvailable() returns false before Strata has enabled, which is handy for optional
soft-dependencies.
What's reachable from StrataApi
| Accessor | Page |
|---|---|
scheduler(plugin) | Scheduler |
text() | Text |
storage() | Storage |
hooks() | Hooks |
metrics() | Metrics |
conditions() | Conditions |
gui() | GUI |
Plus pure-API helpers you construct directly: PdcKey, ConfigSchema, Cooldowns, ItemBuilder,
and the StrataCommand builder.