Build Minecraft PluginsThe Easy Way
Simple Command Manager API and Color API with hex & legacy color code support
Installation
Get started with NextLib in minutes
Gradle
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
compileOnly 'com.github.chi2l3s:next-lib:1.0.0'
// or shade:
// implementation 'com.github.chi2l3s:next-lib:1.0.0'
}Maven
<repositories>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.chi2l3s</groupId>
<artifactId>next-lib</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>Color API
Support for hex and legacy color codes with easy conversion
The Color API provides easy formatting of messages with HEX colors and legacy Minecraft color codes.
import io.github.chi2l3s.nextlib.api.color.ColorUtil;
import io.github.chi2l3s.nextlib.api.color.ColorUtilImpl;
ColorUtil color = new ColorUtilImpl();
// Using HEX colors
player.sendMessage(color.formatMessage("&#FF0000Hello �FF00World"));
// Using legacy codes
player.sendMessage(color.formatMessage("&aHello &bWorld"));
// Mixed
player.sendMessage(color.formatMessage("&aHello &#FF0000World"));Supported Codes:
- &0-&f - Legacy color codes
- &k-&o - Text formatting
- &#RRGGBB - HEX colors
Command Manager
Simple and intuitive command registration and execution
Create powerful command systems with automatic tab completion and permission handling.
public class ExampleCommand extends io.github.chi2l3s.nextlib.api.command.LongCommandExecutor {
public ExampleCommand() {
addSubCommand(new io.github.chi2l3s.nextlib.api.command.SubCommand() {
@Override
public void onExecute(org.bukkit.command.CommandSender sender, String[] args) {
sender.sendMessage("Hello from subcommand!");
}
@Override
public java.util.List<String> onTabComplete(org.bukkit.command.CommandSender sender, String[] args) {
return java.util.List.of("option1", "option2", "option3");
}
}, new String[]{"test", "t"}, new org.bukkit.permissions.Permission("example.use"));
}
}Features:
- ✓ Automatic tab completion
- ✓ Permission checking
- ✓ Multiple aliases support
- ✓ Easy subcommand management
Item Builder
Fluent API for creating and customizing Minecraft items
Create custom items with names, lore, enchantments, and persistent data containers.
io.github.chi2l3s.nextlib.api.item.ItemBuilder builder = new io.github.chi2l3s.nextlib.api.item.ItemBuilder(org.bukkit.Material.DIAMOND_SWORD)
.setName("&a&lEpic Sword")
.setLore(java.util.List.of("&7Damage: &c+10", "&7Crit Chance: &c25%"))
.addEnchant(org.bukkit.enchantments.Enchantment.DAMAGE_ALL, 5, true)
.setUnbreakable(true)
.setPersistentData(this, "custom_item", "epic_sword");
org.bukkit.inventory.ItemStack item = builder.build();
player.getInventory().addItem(item);Builder Methods:
- setDisplayName() - Set custom name
- addLore() - Add lore lines
- addEnchantment() - Add enchantments
- setUnbreakable() - Make unbreakable
- addPDC() - Add persistent data
Config Manager
Easy configuration file management with YAML support
Manage your plugin configuration files with a simple and intuitive API.
class MyConfig extends io.github.chi2l3s.nextlib.api.config.BaseConfig {
public String serverName;
public int maxPlayers;
MyConfig(org.bukkit.plugin.java.JavaPlugin plugin) { super(plugin, "config.yml"); }
protected void loadValues() {
serverName = config.getString("server.name", "My Server");
maxPlayers = config.getInt("server.max-players", 20);
}
}
MyConfig cfg = new MyConfig(this);
cfg.reloadConfig();Supported Types:
- getString() / getInt() / getDouble() / getBoolean()
- getStringList() / getIntList()
- getConfigurationSection()
- set() - Set any value
GUI API
Create interactive GUI menus with minimal code
Build interactive GUI menus by defining them in YAML files. No code needed!
# plugins/YourPlugin/menus/shop.yml
title: "&aShop"
size: 27
items:
close_button:
slot: 26
material: BARRIER
name: "&cClose"
on_left_click:
- closeio.github.chi2l3s.nextlib.api.gui.GuiManager gui = new io.github.chi2l3s.nextlib.api.gui.GuiManager(this);
java.io.File menus = new java.io.File(getDataFolder(), "menus");
gui.loadFromFolder(menus);
gui.openGui(player, "shop");