Lamp
A modern annotations-driven commands framework for Java and Kotlin
Install / Use
/learn @Revxrsal/LampREADME
Lamp
Welcome to Lamp, the versatile and powerful command framework designed for modern Java and Kotlin applications. Whether you're building plugins for Minecraft servers, integrating with Discord, or creating command-line tools, Lamp provides a robust solution with a clean, idiomatic API.
Core Features
- Multi-Platform Support: Easily integrate with various platforms including Bukkit, BungeeCord, Sponge, Velocity, JDA, Minestom, and more.
- Command Management:
- Define commands using simple annotations and manage them effortlessly.
- Use spaces to define subcommands easily
- Have multiple variants of the same command
- Define parameters that come in the middle of the command
- Advanced Parameter Handling: Support for context-based parameters, custom parameter types, and multiple parameter variants.
- Optional parameters: Define optional parameters and default values easily with
@Optionaland@Default - Flags and switches:
- Define Unix-style switches (
--switchand-s) and flags (--value <value>or-v <value>) - Use shorthand-syntax
-s -p -ras-spr
- Define Unix-style switches (
- Response Handling: Configure how command responses are processed with flexible
ResponseHandlers. - Dependency Injection: Inject dependencies directly into command classes using a simple builder pattern.
- Context Resolving: Use context resolvers to handle complex command input scenarios.
- Command Permissions: Use built-in platform permissions, or define your own permission implementation with custom annotations.
- Modular Design with Visitors: Extend Lamp’s functionality through modular visitors for dynamic feature additions.
- Custom annotation support: Lamp allows you to create custom annotations and customize their behaviors.
- Fool-proof: Lamp has been designed to reduce user error as much as possible. It uses idiomatic APIs, immutability, and builders, to ensure you never run into bugs. Combined with extensive compiler annotations that will help you catch any problems at compile-time
Command Examples
@Command("greet user")
@Description("Sends a greeting message")
public void greet(CommandActor actor, @Default("World") String name) {
actor.reply("Hello, " + name + "!");
}
Multiple variants of the same command
@Command("teleport <target> here")
public void teleportHere(Player sender, EntitySelector<LivingEntity> target) {
for (LivingEntity entity : target)
entity.teleport(sender);
}
@Command("teleport")
public void teleport(Player sender, double x, double y, double z) {
sender.teleport(new Location(sender.getWorld(), x, y, z));
}
Easily create aliases of commands
@Command({"gamemode creative", "gmc"})
public void creative(@Default("me") Player sender) {
sender.setGameMode(GameMode.CREATIVE);
}
@Command({"gamemode adventure", "gma"})
public void adventure(@Default("me") Player sender) {
sender.setGameMode(GameMode.ADVENTURE);
}
Support for Kotlin's default arguments
@Command("world")
fun teleportToWorld(
sender: Player,
@Optional target: Player = sender,
@Optional world: World = sender.world
) {
}
Integration with Brigadier
.png?raw=true)
Custom parameter types
@CommandPermission("quests.command")
@Command("quest")
class QuestCommands {
@Dependency
private lateinit var questManager: QuestManager
@Subcommand("create")
fun createQuest(sender: CommandSender, name: String, description: String) {
}
@Subcommand("<quest> delete")
fun deleteQuest(sender: CommandSender, quest: Quest) {
}
@Subcommand("<quest> start")
fun startQuest(sender: Player, quest: Quest) {
}
@Subcommand("clear")
fun clearQuests(sender: CommandSender) {
}
}
Custom permission annotations
@RequiresGroup("admin")
@Command("admin command")
public void adminCommand(BukkitCommandActor actor) {
actor.reply("You are authorized to use this command!")
}
Supports Discord slash commands
@Command("ban")
@Description("Bans the given user")
@CommandPermission(Permission.BAN_MEMBERS)
public void ban(
SlashCommandActor actor,
Member target,
@Range(min = 1) int days
) {
actor.replyToInteraction("User **" + target.getEffectiveName() + "** has been banned!").queue();
}
.png?raw=true)
Multi-platform support
Lamp supports the following platforms out of the box:
- Bukkit / Spigot / Paper
- Brigadier
- BungeeCord
- Velocity
- Sponge
- Minestom
- Fabric
- JDA slash commands
- Command-line applications
Getting Started
To get started with Lamp, follow the instructions in our setup guide. Whether you're using Gradle or Maven, integrating Lamp into your project is straightforward.
For more detailed documentation on each feature, please refer to our detailed book that outlines all features and APIs in Lamp
Happy coding with Lamp! 🚀
Sponsors
If Lamp has made your life significantly easier or you're feeling particularly generous, consider sponsoring the project! It's a great way to support the many hours I've spent maintaining this library and keeps me motivated. Please don't sponsor if you can't afford it.
Huge thanks to those who donated! 😄
If I missed you, or you would like to remain anonymous, feel free to shoot me a DM on Discord)
- Demeng ($50)
- creatorfromhell ($10)
- Azoraqua ($10)
- SuperMax_8 ($8)
- Bed-dev ($6)
Related Skills
node-connect
334.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
334.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.1kCommit, push, and open a PR

