agentsclimarketplace

Commands

Skill MrPippi/MJP-Claude-Skills/docs/velocity/commands

Minecraft Java Plugin Claude Skills

Install
npx -y skills add MrPippi/MJP-Claude-Skills --skill commands

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

4.1 KB, as published. Nobody here has run it

Commands Skill — Velocity

Purpose

Reference this skill when registering proxy-level commands on Velocity. Velocity provides SimpleCommand, RawCommand, and BrigadierCommand interfaces — each suited to different use cases.

When to Use This Skill

  • Adding /proxy-command that players can run on the proxy directly
  • Creating admin commands that work regardless of which backend server the player is on
  • Implementing commands with tab completion at the proxy level

API Quick Reference

Class / MethodPurposeNotes
CommandManager#register(CommandMeta, Command)Register a commandGet manager via server.getCommandManager()
CommandManager#metaBuilder(String)Build command metadataSet aliases and plugin reference
SimpleCommandSimple string-args command interfaceEasiest to implement
RawCommandGets the full raw argument stringFor commands needing custom parsing
BrigadierCommandNative Brigadier treeFull argument types and client-side validation
SimpleCommand.InvocationWraps CommandSource + String[] args
CommandSourceThe executor (Player or ConsoleCommandSource)
CommandManager#hasCommand(String)Check if a command is registered

Code Pattern

package com.yourorg.proxyplugin.commands;

import com.velocitypowered.api.command.CommandMeta;
import com.velocitypowered.api.command.SimpleCommand;
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ProxyServer;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;

import java.util.List;
import java.util.concurrent.CompletableFuture;

// SimpleCommand: the most common command type
public class HubCommand implements SimpleCommand {

    private final ProxyServer server;

    public HubCommand(ProxyServer server) {
        this.server = server;
    }

    @Override
    public void execute(Invocation invocation) {
        if (!(invocation.source() instanceof Player player)) {
            invocation.source().sendMessage(
                Component.text("This command is only for players.").color(NamedTextColor.RED)
            );
            return;
        }

        server.getServer("lobby").ifPresentOrElse(
            lobby -> player.createConnectionRequest(lobby).fireAndForget(),
            () -> player.sendMessage(
                Component.text("Lobby is offline.").color(NamedTextColor.RED)
            )
        );
    }

    @Override
    public boolean hasPermission(Invocation invocation) {
        return invocation.source().hasPermission("network.hub");
    }

    @Override
    public CompletableFuture<List<String>> suggestAsync(Invocation invocation) {
        // No tab completion needed for /hub
        return CompletableFuture.completedFuture(List.of());
    }
}

Register in main class:

CommandMeta meta = server.getCommandManager()
    .metaBuilder("hub")
    .aliases("lobby", "l")
    .plugin(this)
    .build();

server.getCommandManager().register(meta, new HubCommand(server));

Common Pitfalls

  • Not checking if source is Player before casting: Console can execute commands. Always instanceof check before casting invocation.source() to Player.

  • Blocking in execute(): execute() runs on Velocity's command thread. Synchronous database calls will block command processing for all players. Use CompletableFuture.supplyAsync() and schedule UI updates properly.

  • Registering without a plugin reference: Always call .plugin(this) on the CommandMeta builder. Without it, the command won't be cleaned up on plugin unload.

Version Notes

  • Velocity 3.3: SimpleCommand, RawCommand, BrigadierCommand all stable.
  • hasPermission(Invocation) is checked before execute() and before tab completion. Returning false hides the command from the player.

Related Skills

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.