-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This wiki provides documentation and examples for core classes and features in SingularityLib, a Minecraft plugin API designed to streamline plugin development.
SingularityLib is a Minecraft plugin API providing improved command registration, configuration utilities, GUI creation, item and entity management, database support, and Discord integration.
It is a fork of ExperienceLib.
Note: The project is in active development. Bugs and missing features may be present. Report issues here.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.github.pinont</groupId>
<artifactId>SingularityLib</artifactId>
<version>2.2.0</version>
</dependency>
</dependencies>
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'io.github.pinont:SingularityLib:2.2.0'
}
Your main plugin class should extend CorePlugin
instead of JavaPlugin
:
public class Main extends CorePlugin {
@Override
public void onPluginStart() {
// Initialization logic
}
@Override
public void onPluginStop() {
// Cleanup logic
}
}
SingularityLib simplifies command registration and management.
public class FlySpeed implements SimpleCommand {
@Override
public String getName() { return "flyspeed:fs"; }
@Override
public String description() { return "Set Player Flying speed"; }
@Override
public void execute(CommandSourceStack commandSourceStack, String[] args) {
Player player = (Player) commandSourceStack.getSender();
// Command logic here
}
}
public class Vanish implements SimpleCommand {
@Override
public String getName() { return "vanish:v"; }
@Override
public String description() { return "Vanish player"; }
@Override
public void execute(CommandSourceStack commandSourceStack, String[] args) {
// Vanish logic here
}
}
Automatically register annotated components using the Register
class:
Register register = new Register();
register.scanAndCollect("your.package.name");
register.registerAll(plugin);
- Scans for classes annotated with
@AutoRegister
and registers listeners, commands, and custom items.
Create items with custom interactions and appearances by inheriting from CustomItem
.
public class MyCustomItem extends CustomItem {
@Override
public ItemInteraction getInteraction() {
// Define interaction logic
}
@Override
public ItemCreator register() {
// Set visual/item properties
}
}
ItemStack head = new ItemStack(Material.PLAYER_HEAD);
ItemHeadCreator creator = new ItemHeadCreator(head)
.setName("Cool Head")
.setOwner("PlayerName");
ItemStack finalHead = creator.create();
Use EntityCreator
to spawn and configure entities:
EntityCreator creator = new EntityCreator(EntityType.ZOMBIE)
.setMaxHealth(40)
.setVisualFire(true);
Entity zombie = creator.spawn(world, x, y, z);
Manage MySQL connections and configuration easily:
MySQL mysql = new MySQL();
Connection conn = mysql.getConnection();
// Use conn for database operations
If configuration is missing, the class creates a template config and prompts you to fill in credentials.
Listen to custom item interactions with ItemExecuteEvent
:
@EventHandler
public void onItemExecute(ItemExecuteEvent event) {
Player player = event.getPlayer();
ItemStack item = event.getItem();
if (!event.isCancelled()) {
event.execute();
}
}
- FlySpeed Command
- Vanish Command
- CustomItem
- ItemHeadCreator
- Register (Auto-registration)
- EntityCreator
- MySQL Utility
- ItemExecuteEvent
Results above are limited to 10 classes.
View more source files on GitHub
PRs and issues are welcome! Priority feedback areas:
- Command API ergonomics
- Desired GUI patterns (animation, pagination)
- Item metadata extension needs
- Database extensibility
- Paginated & Animated GUI
- Item enchantment & attribute expansion
- Custom entities
- Command aliases and subcommands
- Custom crafting recipes
- Discord event listeners
- Additional database backends (SQLite, MongoDB)
For detailed JavaDocs and more class examples, visit the GitHub repository.
Note: This documentation was generated using code search and may be incomplete. For full class listings and up-to-date docs, browse the repo.