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>
public class DebugCommand extends RootCommand {
public DebugCommand() {
super("debug", "someplugin.commands.debug", false);
addCommand(new SimpleUnloadPlayer());
addCommand(new SimpleLoadPlayer());
addCommand(new SimpleShow());
}
}
public class SimpleLoadPlayer extends SimpleCommand {
public SimpleLoadPlayer() {
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!
}
@Override
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
// Command logic here
return true;
}
}
The SimpleCommands class provides an easy way to register commands. Simply follow the syntax below. Please note that commands with parents CANNOT be registered.
@Override
public class TestPlugin extends JavaPlugin {
@Override
public void onEnable() {
SimpleCommand testCommand = new SimpleTestCommand();
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