CrucialAPI is an open-source, easy-to-use Spigot API that aims to simplify plugin development.
Note: If you have any suggestions, questions, or feedback for this wiki, please use Discussions.
Attention! Do not forget to add CrucialAPI as a dependency in your "plugin.yml" file!
<dependency>
<groupId>io.github.chafficui</groupId>
<artifactId>CrucialAPI</artifactId>
<version>1.2</version>
</dependency>implementation 'io.github.chafficui:CrucialAPI:1.2'publicclassMainextendsJavaPlugin {
privatefinalStringCrucialAPIVersion = "1.2";
/** Auto-download CrucialAPI */@OverridepublicvoidonLoad(){
if(getServer().getPluginManager().getPlugin("CrucialAPI") == null){
try {
URLwebsite = newURL("https://github.com/Chafficui/CrucialAPI/releases/download/v" + CrucialAPIVersion + "/CrucialAPI-v" + CrucialAPIVersion + ".jar");
ReadableByteChannelrbc = Channels.newChannel(website.openStream());
FileOutputStreamfos = newFileOutputStream("plugins/CrucialAPI.jar");
fos.getChannel().transferFrom(rbc, 0L, Long.MAX_VALUE);
Bukkit.getPluginManager().loadPlugin(newFile("plugins/CrucialAPI.jar"));
} catch (IOException | InvalidDescriptionException | org.bukkit.plugin.InvalidPluginExceptione) {
e.printStackTrace();
Bukkit.getPluginManager().disablePlugin(this);
}
}
}
/** Auto-update CrucialAPI */@OverridepublicvoidonEnable(){
if(Server.checkVersion(newString[]{"1.16", "1.15"})){
Crucial.getVersion(CrucialAPIVersion, this);
} else {
//CrucialAPI only supports 1.16 and 1.15Bukkit.getPluginManager().disablePlugin(this);
}
newCrucialItem("Super shovel", Material.DIAMOND_SHOVEL, "item").setCrafting(newString[]{"Air", "AIR", "AIR", "DIAMOND", "DIAMOND", "DIAMOND", "AIR", "AIR", "AIR"});
}
}You can get the latest stable release build here: Stable Build
If you want the most up-to-date builds, you can find them here: Releases
Documentation
Currently, some parts of CrucialAPI lack proper documentation. However, we are working hard to improve it!
If you need help or want to chat with the CAPI team or other developers, you can join the Official ChafficPlugins Discord Server.
Alternatively, you can use the Discussions section.
This project requires Spigot 1.15 or higher.
Here are some additional information about LTS versions:
| Version | Supported |
|---|---|
| 2.2.x | ✅ |
| 2.1.x | ❌ |
| 2.0.x | ❌ |
| 1.x.x | ❌ |