CoreLib is a comprehensive utility library that makes Minecraft plugin development actually enjoyable. If you've ever found yourself writing the same boilerplate code for the hundredth time, or fighting with version-specific implementations, this library is for you.
Minecraft plugin development can be frustrating. Simple tasks often require excessive boilerplate, version-specific code, or external dependencies that break with every update. CoreLib solves these pain points by providing a clean, modern API that just works.
No more implementing CommandExecutor repeatedly. CoreLib uses a modern, lambda-based approach:
CoreLib.commands().register("test", ctx -> {
ctx.reply("It works!");
});
Advanced packet handling through Netty pipeline injection:
- Intercept, modify, or cancel any packet
- JavaScript-based packet filters (powered by Rhino)
- Client-side only entities and blocks
- Packet history tracking for debugging
- Network traffic export for analysis
Full MiniMessage support with an intuitive placeholder system:
player.send("<gold>Welcome back, %player%! <gray>You have <green>%balance%</green> coins.");
- Built-in placeholders for common values
- Custom placeholder registration
- Legacy color code support for compatibility
Lambda-based event handling that eliminates boilerplate:
EventBus.on(PlayerJoinEvent.class, event -> {
event.getPlayer().sendMessage("Welcome!");
});
A sane wrapper around Bukkit's scheduler with static access:
CoreScheduler.runLater(() -> {
// Your code here
}, 20L); // 1 second delay
Cross-version NBT manipulation without external dependencies:
NBTItem nbt = CoreLib.nbt().getItem(itemStack);
nbt.setString("custom-id", "special_sword");
nbt.setInt("custom-damage", 150);
- Player Cache: High-performance player data caching
- Config Manager: Centralized configuration handling
- Version Detection: Automatic version compatibility checking
- Text Components: Adventure API integration for rich text
Step 1. Add JitPack repository to your build file
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.mrcappyy:CoreLib:main-SNAPSHOT'
}
Step 1. Add the JitPack repository
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Step 2. Add the dependency
<dependency>
<groupId>com.github.mrcappyy</groupId>
<artifactId>CoreLib</artifactId>
<version>main-SNAPSHOT</version>
</dependency>
public class MyPlugin extends JavaPlugin {
private CoreLib coreLib;
@Override
public void onEnable() {
// CoreLib auto-initializes when loaded
coreLib = CoreLib.getInstance();
// Register a command
coreLib.getCommandManager()
.command("hello")
.executor(ctx -> ctx.reply("Hello, world!"))
.register();
}
}
// Listen for chat packets
CoreLib.packets().onReceive(PacketType.PLAY_CLIENT_CHAT, event -> {
String message = event.getPacket().getStrings().read(0);
if (message.contains("blocked")) {
event.setCancelled(true);
event.getPlayer().sendMessage("That word is not allowed!");
}
});
- Paper 1.19 - 1.21
- Java 21 or higher
- No external dependencies (everything is bundled)
CoreLib includes several built-in commands for debugging and management:
/corelib
- Main management command/corelib reload
- Reload configurations/corelib debug
- Toggle debug mode/packet
- Packet manipulation tools/clutil
- Various utility commands
CoreLib is designed with performance in mind:
- Concurrent data structures for thread safety
- Lazy initialization where possible
- Minimal reflection caching
- Zero external runtime dependencies
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
CoreLib is licensed under the MIT License. See LICENSE file for details.
- Issues: GitHub Issues
Built with love (and mild frustration) by MrCappy.