Repository navigation
Automation API
Four building blocks for mods, available from ControlCoreApi.get() (or find()).
api.notifications().message(player, "Hello");
api.notifications().message(player, "Careful!", "#ff5555");
api.notifications().broadcast("Restart in 5 minutes");
api.notifications().toAdmins("Backup finished");
api.notifications().title(player, "Welcome!", "Have fun");
api.notifications().titleAll("Event", "starts now");SchedulerApi.Task task = api.scheduler().every(Duration.ofMinutes(30), () -> ...);
api.scheduler().later(Duration.ofSeconds(10), () -> ...);
api.scheduler().dailyAt(LocalTime.of(20, 0), () -> ...);
task.cancel();Work runs on a background thread; hop to a world's thread before touching that world. A failing run is logged and later runs continue.
api.sessions().find(player).ifPresent(session -> {
Duration total = session.playtime(); // including the current session
Instant first = session.firstJoin();
boolean online = session.online();
});
api.sessions().world(player); // the world the player is inOffer an action admins can pick in the Automation tab ("Mod action" with the value homes:reset-homes):
api.actions().register(AutomationAction.of("homes", "reset-homes")
.displayName("Reset everyone's homes")
.run(context -> homes.resetAll()));ActionContext holds the rule's name, the player (if the trigger had one), the text the admin typed after the id
(with placeholders filled in) and the trigger's placeholders.
Announce your own trigger ("A mod's trigger" with the value arena:match-won) and fire it:
api.actions().registerTrigger("arena", "match-won", "An arena match is won");
api.actions().fire("arena", "match-won", Optional.of(winner), Map.of("arena", "Lava pit"));Rules can then use {arena}. /cc-rules lists every registered action and trigger.
ControlCore · GitHub · CurseForge · MIT license · This wiki is generated from the repository's wiki/ folder: edit it there, not here.
Server owners
- Installing
- Control panel
- Commands
- Permissions
- Key binds
- HUD
- Mods tab
- Automation
- Files and settings
- Troubleshooting
Players
Mod authors