A shared foundation library for my Minecraft Paper plugins.
Basalt extracts common patterns and utilities from my plugins into a reusable base layer. This keeps individual plugins slim and focused on their domain logic rather than reimplementing generic infrastructure.
This is not a public library. It's designed specifically for my own plugins and may change without notice. If you're looking for a general-purpose Minecraft library, this isn't it.
Generic component architecture for building entity-attached behaviors:
Component<E, I>- Base interface for attachable componentsTickable<E, I>- Components that process on intervalsStatefulComponent<E, I>- Components with active/inactive states
Composable predicates with logical operators:
Condition<T>- Generic condition interface withand(),or(),negate()CompositeCondition<T>- Combines multiple conditionsPlayerConditions- Pre-built conditions for Players (time, weather, moon phase, equipment, world type)
Type-safe registration for game objects:
Registry<T>- Generic registry with lookup, validation, and logging
PlayerManager<T>- Tracks per-player state with filtering and caching
Persistence layer for player data:
Storage<T>- Generic async storage interface (load, save, delete, exists, loadByName)AbstractSqlStorage<T>- Base SQL implementation with:- Virtual thread executor for non-blocking I/O
- Transaction support via
executeInTransaction() - Two usage patterns:
- Simple: Override SQL getters and serialization methods for single-table schemas
- Complex: Override sync methods (
loadSync,saveSync, etc.) for multi-table schemas
PlayerData- Interface for persistable player data (getUuid, getUsername)
TimeUtil- Minecraft time/moon phase calculationsTaskUtil- Scheduler helpersMessageUtil- Text formattingActionBarDisplay- Action bar message management
TimeTransitionListener- Day/night and moon phase change events
Add as a dependency in your build.gradle:
dependencies {
implementation 'com.dnocturne:basalt:1.0.0'
}PRs and contributions are welcome.
Apache License 2.0