Provides a simple, easy to work with command framework for minecraft spigot servers.
- Full developer control, just implement the onCommand() method just like you normally would!
- Simple nesting of commands
- Simple permission handling
- Stack permission nodes
- Tab completion for subcommands
- Automatic (customizable) help generator that respects permissions!
In order to use SimpleCommands you need to import the project using Maven or simply copy the files into your project. The latest release tag can be seen in the shield above.
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories><dependencies>
<dependency>
<groupId>com.github.MartenM</groupId>
<artifactId>SimpleCommands</artifactId>
<version>[FROM JitPack badge]</version>
</dependency>
</dependencies>publicclassDebugCommandextendsRootCommand {
publicDebugCommand() {
super("debug", "someplugin.commands.debug", false);
addCommand(newSimpleUnloadPlayer());
addCommand(newSimpleLoadPlayer());
addCommand(newSimpleShow());
}
}publicclassSimpleLoadPlayerextendsSimpleCommand {
publicSimpleLoadPlayer() {
super("load", "+loadplayer", true);
// The + symbol means that this permission will be attached to that of the parent.// This allows for easy permission stacking but keeps options open to do whatever you want!
}
@OverridepublicbooleanonCommand(CommandSendersender, Commandcommand, Strings, String[] args) {
// Command logic herereturntrue;
}
}The SimpleCommands class provides an easy way to register commands. Simply follow the syntax below. Please note that commands with parents CANNOT be registered.
@OverridepublicclassTestPluginextendsJavaPlugin {
@OverridepublicvoidonEnable() {
SimpleCommandtestCommand = newSimpleTestCommand();
testCommand.registerCommand(this);
}
}You are done!
The wiki offers a guide for almost everything this libary covers. Check it out here: https://github.com/MartenM/SimpleCommands/wiki
These are features planned for upcoming releases.
- Hide commands from the help formatter
- Add documentation on isAllowed() overwrites