Spigot Command API
1.0-SNAPSHOTA lightweight, easy to use, extremely useful Spigot Command API
This is a Spigot Command API made by me, it's extremely useful & easy to use.
How to use
Copy and paste the code at the bottom of the page, into a new class called something like 'ACommand'.
In your onEnable() initialize each command by doing
new ExampleCommand();
After initializing each command here, just create the classes and make them extend ACommand.
Here's an example command.
public class ExampleCommand extends ACommand {
// You can now register how ever many subcommands and regular commands you'd like
// This is a basic command
// The syntax for this would just be /example
@Command(name = "example")
public void exampleCommand(Arguments arguments) {
arguments.getPlayer().sendMessage(ChatColor.GREEN + "Hello!");
}
// This is an example of a command with an option for
// the player to fill in the command argument.
// The syntax for this command would be /example teleport <player-name>
@Command(name = "example.teleport.<player>", permission = "command.teleport", aliases = new String[] { tp }, playersOnly = true)
public void teleportCommand(Arguments arguments) {
// Now we can get the first argument as there
// is only one unknown argument in this command.
arguments.getPlayer().teleport(Bukkit.getPlayer(arguments.getArguments().get(0)));
}
// You can also have help pages for if the base command is found
// although a subcommand is not found for it.
@Help(command = "example")
public void helpMessage(CommandSender sender) {
sender.sendMessage("You can use /example teleport <player> or /example");
}
}Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta