-
Notifications
You must be signed in to change notification settings - Fork 0
02 getting started
github-actions[bot] edited this page May 5, 2026
·
1 revision
This guide will walk you through setting up KLibrary in your Paper plugin project.
You can add KLibrary as a dependency using Maven or Gradle.
<dependency>
<groupId>io.github.kaivian</groupId>
<artifactId>klibrary</artifactId>
<version>1.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>dependencies {
implementation 'io.github.kaivian:klibrary:1.0.0-SNAPSHOT'
}To use KLibrary within your Paper plugin, initialize the core registry managers in your JavaPlugin implementation's onEnable method.
import io.github.kaivian.klibrary.action.api.ActionFactory;
import io.github.kaivian.klibrary.requirement.api.RequirementFactory;
import org.bukkit.plugin.java.JavaPlugin;
public class MyPlugin extends JavaPlugin {
private ActionFactory actionFactory;
private RequirementFactory requirementFactory;
@Override
public void onEnable() {
// Initialize the library factories
this.actionFactory = new ActionFactory(this);
this.requirementFactory = new RequirementFactory(this);
// Register default and custom built-in actions/requirements
// actionFactory.registerDefaults();
// requirementFactory.registerDefaults();
getLogger().info("MyPlugin with KLibrary enabled!");
}
}KLibrary supports common plugins as optional dependencies. The underlying Service layer automatically handles their resolution.
Ensure your plugin.yml or paper-plugin.yml declares these dependencies if you wish to use them.
name: MyPlugin
version: 1.0.0
main: com.example.myplugin.MyPlugin
api-version: '1.21'
dependencies:
server:
PlaceholderAPI:
load: BEFORE
required: false
join-classpath: true
Vault:
load: BEFORE
required: false
join-classpath: trueKLibrary will silently and safely handle cases where Vault or PlaceholderAPI are absent without causing runtime exceptions.
Next: Core Concepts
KLibrary by Kaivian © 2026. All rights reserved.