Build plugins and integrations against taktOS – manage services, groups, players, permissions and more from your own code, without touching the network protocol.
This page is a preview of what the TaktCloud API will offer. The API is not part of the
cloud download yet – once it is ready it will be shipped as a separate download
(its own taktcloud-api.jar) so you can add it to your plugin projects.
The TaktCloud API is a small Java library you add to a plugin running on a cloud server (Paper) or on the proxy (Velocity). It gives you a clean, typed entry point to everything taktOS manages – so you never have to build packets or parse JSON yourself.
These are the areas the API is planned to expose. Each one mirrors a subsystem taktOS already runs today.
A quick tour of the surface. Everything hangs off the single
TaktCloud.api() entry point.
import dev.taktcloud.api.TaktCloud;
import dev.taktcloud.api.service.ServiceInfo;
var api = TaktCloud.api();
// every running Lobby instance
for (ServiceInfo s : api.services().ofGroup("Lobby")) {
System.out.println(s.getName() + " @ " + s.getHost() + ":" + s.getPort()
+ " – " + s.getOnlinePlayers() + "/" + s.getMaxPlayers());
}
// start two more BedWars instances, stop one lobby
api.services().start("BedWars", 2);
api.services().stop("Lobby-1");
api.players().find("Notch").ifPresent(p -> p.connect("Lobby"));
// send everyone on a dying server back to the lobby
api.players().on("BedWars-3").forEach(p -> p.connect("Lobby"));
boolean canFly = api.permissions().has(uuid, "taktcloud.fly");
api.permissions().group("vip")
.add("taktcloud.fly")
.setPrefix("&6[VIP] &r")
.save();
api.maintenance().enable(); // whole proxy
api.maintenance().enable("Lobby"); // only the Lobby group
api.maintenance().whitelist().add("Notch");
api.events().on(ServiceStartEvent.class, e ->
getLogger().info(e.service().getName() + " is now online"));
api.events().on(PlayerSwitchEvent.class, e ->
getLogger().info(e.player().getName() + " → " + e.to().getName()));
api.messaging().channel("myminigame")
.onMessage((from, data) -> handle(from, data));
api.messaging().channel("myminigame")
.send("Lobby-1", "party-invite:Notch");
Once the API is released, adding it to a plugin takes three steps. It is a provided dependency – the cloud already ships the runtime, so you only compile against it.
Drop taktcloud-api.jar from the separate download into your project, or use it from your local Maven repository. Scope it provided so it is not shaded into your plugin.
<dependency>
<groupId>dev.taktcloud</groupId>
<artifactId>taktcloud-api</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
compileOnly("dev.taktcloud:taktcloud-api:1.0.0")
So the cloud loads before your plugin and the API is ready when you ask for it.
name: MyPlugin
main: com.example.MyPlugin
version: 1.0
depend: [TaktCloud]
@Plugin(id = "myplugin", dependencies = {
@Dependency(id = "taktcloud")
})
Grab the singleton in onEnable and keep it. That is it.
public class MyPlugin extends JavaPlugin {
private TaktCloudAPI cloud;
@Override
public void onEnable() {
cloud = TaktCloud.api();
getLogger().info("Connected to " + cloud.services().all().size() + " services");
}
}
The API is a thin, stable wrapper over the taktOS packet protocol that every release already
speaks. That means it is designed to work with all previous cloud versions – you keep
your current taktOS.jar and just add the API to your plugin. The API carries its
own version number and evolves without forcing a cloud update.