API Overview
SigmaTools provides a public API for developers to interact with tools, check permissions, manage economy, and listen to events.
Accessing the APIโ
Provided via Bukkit's ServicesManager:
SigmaToolsAPI api = Bukkit.getServicesManager().load(SigmaToolsAPI.class);
if (api == null) {
getLogger().warning("SigmaToolsAPI not available");
return;
}
String version = api.getVersion();
Load order can cause the API to be unavailable at onEnable() time - retry one tick later if null:
@Override
public void onEnable() {
SigmaToolsAPI api = Bukkit.getServicesManager().load(SigmaToolsAPI.class);
if (api == null) {
Bukkit.getScheduler().runTask(this, () -> {
SigmaToolsAPI retried = Bukkit.getServicesManager().load(SigmaToolsAPI.class);
if (retried != null) initializeAPI(retried);
});
} else {
initializeAPI(api);
}
}
Dependency Setupโ
<dependency>
<groupId>com.sigmatools</groupId>
<artifactId>SigmaTools</artifactId>
<version>1.0.3</version>
<scope>provided</scope>
</dependency>
The API is not published to Maven Central - install the JAR locally, add it to your build path, or (recommended) resolve it at runtime only via ServicesManager as shown above.
Methods and Eventsโ
Full signatures: API Reference for methods, Events for events. Method groups: tool identification (isSigmaTool, getToolType, getToolId), usage/protection (canUseHere), economy (getActiveCurrency, getBalance, deduct, reward), introspection (getAvailableToolTypes, getToolConfig, getVersion). Events: SigmaToolUseEvent, SigmaToolEconomyDeductEvent, SigmaToolEconomyRewardEvent.