SkillAgentSearch skills...

CommandAPI

A simplistic, yet easy to use command API.

Install / Use

npx skills add NoSequel/CommandAPI

Installs into whichever agent you are using.

About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Command API

An opensource command API for the spigot API

Usage

Making a new command implementation:

import io.github.nosequel.Command;
import io.github.nosequel.Param;
import io.github.nosequel.Subcommand;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;

public class ExampleCommand {

    @Command(label = "example")
    public void example(BukkitCommandExecutor player, @Param(name = "text", value = "hello") String text, @Param(name = "description") String description) {
        player.sendMessage(ChatColor.RED + text);
        player.sendMessage(ChatColor.YELLOW + description);
    }

    @Subcommand(parentLabel = "example", label = "sheep")
    public void sheep(BukkitCommandExecutor player, String entityType) {
        final Location location = player.getPlayer().getLocation();
        final EntityType type = EntityType.valueOf(entityType);
        
        location.getWorld().spawnEntity(location, type);
    }

}

Making a new type adapter implementation:

import java.util.UUID;

public class UUIDTypeAdapter implements TypeAdapter<UUID> {

    /**
     * Convert a {@link String} to the {@link Double} object type
     *
     * @param executor the executor of the command
     * @param source   the source to convert
     * @return the converted object
     */
    @Override
    public UUID convert(CommandExecutor executor, String source) throws Exception {
        return UUID.fromString(source);
    }
    
}

Registering the command you've just created:

import com.sun.corba.se.impl.activation.CommandHandler;
import io.github.nosequel.CommandHandler;
import org.bukkit.plugin.java.JavaPlugin;

public class ExamplePlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        final CommandHandler commandHandler = new BukkitCommandHandler("commands");

        commandHandler.registerTypeAdapter(UUID.class, new UUIDTypeAdapter());
        commandHandler.registerCommand(new ExampleCommand());
    }
}

Related Skills

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated1mo ago
Forks0

Languages

Java

Security Score

70/100

Audited on Jul 9, 2026

No findings