Build Minecraft Plugins The Easy Way
NextLib is a modular library for Paper/Spigot plugins that covers basic development tasks: working with configs, GUIs, objects, and databases. All modules are focused on a declarative style and convenient integration into existing projects.
update, playsound, command, opengui, etc.).& codes without extra code.Add the JitPack repository and dependency 1.0.5 to your build script.
repositories {
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
implementation("com.github.chi2l3s:next-lib:1.0.5")
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.chi2l3s:next-lib:1.0.5'
}
<repositories>
<repository>
<id>jitpack</id>
<url>https://jitpack.io/</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.chi2l3s</groupId>
<artifactId>next-lib</artifactId>
<version>1.0.5</version>
<scope>provided</scope>
</dependency>
GUIManager and load the menu from the menus/ folder.@PrimaryKey and register them in `DynamicDatabase'.public final class NextTrapsPlugin extends JavaPlugin {
private DynamicDatabase database;
private GuiManager guiManager;
@Override
public void onEnable() {
database = DatabaseManager.createDynamicDatabase(this, "jdbc:mysql://localhost:3306/nexttraps", config -> {
config.setUsername("root");
config.setPassword("password");
config.setMaximumPoolSize(10);
});
database.register(PlayerEntity.class);
guiManager = new GuiManager(this);
guiManager.loadFromFolder(new File(getDataFolder(), "menus"));
}
}
getCommand("nextlib").setExecutor(new RootCommand());
ItemStack reward = new ItemBuilder(Material.DIAMOND)
.setName("&B Reward of the day")
.setLore(List.of("&7 Press to get"))
.addPersistentTag("reward", PersistentDataType.STRING, "daily")
.glow()
.build();
& and HEX (&#RRGGBB) into color messages.player.SendMessage(color.format("Welcome to ඪdbNextLib"));
@PrimaryKey annotation marks the primary key field.DynamicTable provides the methods findFirst, findMany', create, updateanddelete'.@AllArgsConstructor
@Getter
public class PlayerEntity {
@PrimaryKey
private final UUID playerId;
private final String nickname;
private final String trapSkinId;
}
DynamicTable<PlayerEntity> players = database.table(PlayerEntity.class);
String trapSkinId = players.findFirst()
.where("playerId", playerId)
.execute()
.map(PlayerEntity::getTrapSkinId)
.orElse("fallback");
For more information, see the separate manual docs/dynamic—database.md.
plugins/<Your login >/menus.slot field takes a single value, and slots is a list of arbitrary slots or ranges `A-B'.Conditions#register) and use them to highlight objects or restrict interaction.in actions: close, command', console', message', opengui, update', playsound'.id: traps
title: "&8 Trap Selection"
size: 54
items:
back:
material: ARROW
slot: 53
name: "&7node"
onLeftClick:
- "opengui main"
trap:
material: TRIPWIRE_HOOK
slots:
- 0-8
- 18
name: "&b%trap_name%"
lore:
- "&7 Cost: &e%price%"
enchanted_when:
- "selected"
onLeftClick:
- "update"
- "playsound ENTITY_ENDER_DRAGON_AMBIENT 0.7 1.2"
For a detailed guide and examples, see docs/gui—conditions.md.
public class TrapSkinsConfig extends BaseConfig {
@Override
protected void loadValues() {
ConfigurationSection skins = config.getConfigurationSection("skins");
// Convert YAML to your TrapSkin objects
}
}
MIT License © 2025 NextGenTech