HomeJavaModsNextLib
NextLib
ModsJava

NextLib

by chi2l3s · on Modrinth

Build Minecraft Plugins The Easy Way. Free Minecraft Java mod for 1.16.5, 1.17, 1.17.1.

⬇ Download on Modrinth

NextLib

WIKI

CodeFactor License: MIT Java Gradle JitPack Downloads GitHub last commit GitHub issues GitHub pull requests

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.


Content

  1. Features
  2. Installation
  3. Quick start
  4. Main modules
  5. GUI API and Conditions
  6. Working with configs
  7. Roadmap
  8. License

Features


Installation

Add the JitPack repository and dependency 1.0.5 to your build script.

Gradle (Kotlin DSL)

repositories {
    mavenCentral()
    maven("https://jitpack.io")
}

dependencies {
    implementation("com.github.chi2l3s:next-lib:1.0.5")
}

Gradle (Groovy DSL)

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.chi2l3s:next-lib:1.0.5'
}

Maven

<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>

Quick start

  1. Download the library via JitPack and add it as a dependency.
  2. Create an instance of GUIManager and load the menu from the menus/ folder.
  3. Describe the database entities with Java classes, annotate the primary key @PrimaryKey and register them in `DynamicDatabase'.
  4. Use the provided APIs for commands, items, and configurations — all functionality is available from the namespace `io.github.chi2l3s.nextlib.api'.
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"));
    }
}

Main modules

Command API

getCommand("nextlib").setExecutor(new RootCommand());

Item API

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();

Color API

player.SendMessage(color.format("Welcome to &#3498dbNextLib"));

Config Manager


Dynamic database

@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.


GUI API and terms

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.


Working with configs

public class TrapSkinsConfig extends BaseConfig {
    @Override
    protected void loadValues() {
        ConfigurationSection skins = config.getConfigurationSection("skins");
        // Convert YAML to your TrapSkin objects
    }
}

Useful links


Roadmap


License

MIT License © 2025 NextGenTech


Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more