Token导航 LogoToken导航TokenDH.com
待分类只读github未标认证来源可访问clear审计通过

hytale-commandshytale 命令

Agent Skill

hytale-commands 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

360

周安装

15

GitHub Stars

3

下载量

120
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:hytale-commands(hytale 命令)
来源仓库:https://github.com/mnkyarts/hytale-skills
仓库路径:skills/hytale-commands
安装命令:
npx skills add https://github.com/mnkyarts/hytale-skills --skill hytale-commands
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/mnkyarts/hytale-skills --skill hytale-commands

简介

hytale-commands 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 适用于代码协作、项目管理和命令执行等场景,帮助 Agent 处理仓库相关事务。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法和功能细节。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 可结合来源仓库和 SKILL.md 继续核验具体用法,确保与当前宿主环境兼容。

SKILL.md

Hytale Custom Commands

Complete guide for creating custom server commands with arguments, permissions, tab completion, and execution handling.

When to use this skill

Use this skill when:

  • Creating new slash commands for players or admins
  • Adding command arguments (required, optional, flags)
  • Setting up command permissions
  • Creating command collections/groups
  • Implementing async commands for long-running operations
  • Adding tab completion for arguments

Command Architecture Overview

Hytale uses a command system based on abstract command classes with typed arguments. Commands are registered through the plugin's CommandRegistry and managed by the CommandManager singleton.

Command Class Hierarchy

AbstractCommand
├── CommandBase              # Base for simple commands
├── AbstractAsyncCommand     # For async execution
├── AbstractPlayerCommand    # Requires player sender
├── AbstractWorldCommand     # Requires world context
├── AbstractTargetPlayerCommand    # Target another player
└── AbstractCommandCollection      # Group of subcommands

Command Flow

Player Input -> CommandManager -> Parse Arguments -> Check Permissions -> Execute

Basic Command Implementation

Simple Command

package com.example.myplugin.commands;

import com.hypixel.hytale.server.core.command.CommandBase;
import com.hypixel.hytale.server.core.command.CommandContext;

public class HelloCommand extends CommandBase {

    public HelloCommand() {
        super("hello", "Says hello to the world");
    }

    @Override
    protected void execute(CommandContext ctx) {
        ctx.sendSuccess("Hello, World!");
    }
}

Registration in Plugin

@Override
protected void setup() {
    getCommandRegistry().registerCommand(new HelloCommand());
    getCommandRegistry().registerCommand(new SpawnCommand());
    getCommandRegistry().registerCommand(new TeleportCommand());
}

Command Arguments

Argument Types

ArgTypeDescriptionExample Value
STRINGText string"hello"
INTEGERWhole number42
FLOATDecimal number3.14
BOOLEANTrue/falsetrue
PLAYER_REFOnline playerPlayerName
WORLDWorld nameworld_overworld
ITEM_IDItem identifierhytale:sword
BLOCK_IDBlock identifierhytale:stone
ENTITY_TYPE_IDEntity typehytale:zombie
RELATIVE_INT_POSITIONBlock position~10 ~0 ~-5
RELATIVE_POSITIONPrecise position~10.5 ~0 ~-5.5
DIRECTIONDirection vectornorth, up
DURATIONTime duration10s, 5m, 1h
JSONJSON object{"key":"value"}
GREEDY_STRINGRest of input"hello world"

Argument Kinds

// Required argument - must be provided
RequiredArg<String> nameArg = new RequiredArg<>("name", ArgType.STRING);

// Optional argument - can be omitted
OptionalArg<Integer> countArg = new OptionalArg<>("count", ArgType.INTEGER);

// Default argument - uses default if omitted
DefaultArg<Integer> amountArg = new DefaultArg<>("amount", ArgType.INTEGER, 1);

// Flag argument - boolean switch
FlagArg silentFlag = new FlagArg("silent", "s");

Command with Arguments

public class GiveCommand extends CommandBase {

    private static final RequiredArg<PlayerRef> TARGET =
        new RequiredArg<>("target", ArgType.PLAYER_REF);
    private static final RequiredArg<ItemId> ITEM =
        new RequiredArg<>("item", ArgType.ITEM_ID);
    private static final DefaultArg<Integer> AMOUNT =
        new DefaultArg<>("amount", ArgType.INTEGER, 1);
    private static final FlagArg SILENT =
        new FlagArg("silent", "s");

    public GiveCommand() {
        super("give", "Give items to a player");
        addArg(TARGET);
        addArg(ITEM);
        addArg(AMOUNT);
        addArg(SILENT);
    }

    @Override
    protected void execute(CommandContext ctx) {
        Player target = ctx.get(TARGET).resolve();
        ItemId item = ctx.get(ITEM);
        int amount = ctx.get(AMOUNT);
        boolean silent = ctx.has(SILENT);

        // Give the item
        target.getInventory().addItem(item, amount);

        if (!silent) {
            ctx.sendSuccess("Gave " + amount + "x " + item + " to " + target.getName());
        }
    }
}

Specialized Command Classes

Player-Only Command

Automatically checks that sender is a player. The execute method receives 5 parameters:

import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.server.core.command.system.CommandContext;
import com.hypixel.hytale.server.core.command.system.basecommands.AbstractPlayerCommand;
import com.hypixel.hytale.server.core.universe.PlayerRef;
import com.hypixel.hytale.server.core.universe.world.World;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import javax.annotation.Nonnull;

public class FlyCommand extends AbstractPlayerCommand {

    public FlyCommand() {
        super("fly", "Toggle flight mode");
    }

    @Override
    protected void execute(
        @Nonnull CommandContext context,
        @Nonnull Store<EntityStore> store,
        @Nonnull Ref<EntityStore> ref,
        @Nonnull PlayerRef playerRef,
        @Nonnull World world
    ) {
        // Access player data through PlayerRef
        String username = playerRef.getUsername();

        // Execute on world thread for world modifications
        world.execute(() -> {
            context.sendSuccess("Flight toggled for " + username);
        });
    }
}

World Context Command

Requires a world context:

public class TimeCommand extends AbstractWorldCommand {

    private static final RequiredArg<Integer> TIME =
        new RequiredArg<>("time", ArgType.INTEGER);

    public TimeCommand() {
        super("time", "Set world time");
        addArg(TIME);
    }

    @Override
    protected void execute(CommandContext ctx, World world) {
        int time = ctx.get(TIME);
        world.setTime(time);
        ctx.sendSuccess("Set time to " + time + " in " + world.getName());
    }
}

Target Player Command

For commands that target another player:

public class HealCommand extends AbstractTargetPlayerCommand {

    public HealCommand() {
        super("heal", "Heal a player to full health");
    }

    @Override
    protected void execute(CommandContext ctx, Player target) {
        target.setHealth(target.getMaxHealth());
        ctx.sendSuccess("Healed " + target.getName());
    }
}

Async Command

For long-running operations:

public class BackupCommand extends AbstractAsyncCommand {

    public BackupCommand() {
        super("backup", "Create world backup");
    }

    @Override
    protected CompletableFuture<Void> executeAsync(CommandContext ctx) {
        return CompletableFuture.runAsync(() -> {
            ctx.sendMessage("Starting backup...");
            // Perform backup operation
            performBackup();
            ctx.sendSuccess("Backup complete!");
        });
    }
}

Command Collections (Subcommands)

Group related commands together:

public class AdminCommands extends AbstractCommandCollection {

    public AdminCommands() {
        super("admin", "Admin commands");

        // Register subcommands
        addSubCommand(new BanSubCommand());
        addSubCommand(new KickSubCommand());
        addSubCommand(new MuteSubCommand());
    }

    // Subcommand implementation
    private class BanSubCommand extends CommandBase {

        private static final RequiredArg<PlayerRef> TARGET =
            new RequiredArg<>("target", ArgType.PLAYER_REF);
        private static final OptionalArg<String> REASON =
            new OptionalArg<>("reason", ArgType.GREEDY_STRING);

        public BanSubCommand() {
            super("ban", "Ban a player");
            addArg(TARGET);
            addArg(REASON);
        }

        @Override
        protected void execute(CommandContext ctx) {
            Player target = ctx.get(TARGET).resolve();
            String reason = ctx.getOrDefault(REASON, "No reason provided");
            // Ban logic
            ctx.sendSuccess("Banned " + target.getName() + ": " + reason);
        }
    }
}

Usage: /admin ban PlayerName Being naughty

Permissions

Auto-Generated Permissions

Commands automatically get permissions based on plugin identity:

{plugin.group}.{plugin.name}.command.{commandName}

Example: com.example.myplugin.command.give

Custom Permissions

public class SecretCommand extends CommandBase {

    public SecretCommand() {
        super("secret", "A secret command");
        // Override default permission
        setPermission("admin.secret.access");
    }

    @Override
    protected void execute(CommandContext ctx) {
        ctx.sendSuccess("You found the secret!");
    }
}

Permission Checks in Execution

@Override
protected void execute(CommandContext ctx) {
    if (!ctx.hasPermission("special.feature")) {
        ctx.sendError("You don't have permission for this feature!");
        return;
    }
    // Execute feature
}

Command Context

The CommandContext provides access to sender info and utilities:

@Override
protected void execute(CommandContext ctx) {
    // Get sender info
    CommandSender sender = ctx.getSender();
    boolean isPlayer = ctx.isPlayer();
    boolean isConsole = ctx.isConsole();

    // Get player if sender is player
    Optional<Player> player = ctx.getPlayerSender();

    // Get world context
    Optional<World> world = ctx.getWorld();

    // Send messages
    ctx.sendMessage("Plain message");
    ctx.sendSuccess("Success message");  // Green
    ctx.sendError("Error message");      // Red
    ctx.sendWarning("Warning message");  // Yellow

    // Get argument values
    String name = ctx.get(NAME_ARG);
    int count = ctx.getOrDefault(COUNT_ARG, 10);
    boolean hasFlag = ctx.has(SOME_FLAG);

    // Check permissions
    boolean canUse = ctx.hasPermission("some.permission");
}

Tab Completion

Arguments provide automatic tab completion. Custom completion:

public class CustomArg extends RequiredArg<String> {

    public CustomArg() {
        super("mode", ArgType.STRING);
    }

    @Override
    public List<String> getSuggestions(CommandContext ctx, String partial) {
        return List.of("easy", "medium", "hard")
            .stream()
            .filter(s -> s.startsWith(partial.toLowerCase()))
            .toList();
    }
}

Complete Example Plugin

package com.example.admintools;

import com.hypixel.hytale.server.core.plugin.JavaPlugin;
import com.hypixel.hytale.server.core.plugin.JavaPluginInit;
import javax.annotation.Nonnull;

public class AdminToolsPlugin extends JavaPlugin {

    public AdminToolsPlugin(@Nonnull JavaPluginInit init) {
        super(init);
    }

    @Override
    protected void setup() {
        // Register individual commands
        getCommandRegistry().registerCommand(new HealCommand());
        getCommandRegistry().registerCommand(new FlyCommand());
        getCommandRegistry().registerCommand(new TeleportCommand());

        // Register command collection
        getCommandRegistry().registerCommand(new AdminCommands());

        getLogger().atInfo().log("AdminTools commands registered!");
    }
}

Best Practices

Argument Validation

@Override
protected void execute(CommandContext ctx) {
    int amount = ctx.get(AMOUNT);

    // Validate ranges
    if (amount < 1 || amount > 64) {
        ctx.sendError("Amount must be between 1 and 64");
        return;
    }

    // Continue execution
}

Error Handling

@Override
protected void execute(CommandContext ctx) {
    try {
        Player target = ctx.get(TARGET).resolve();
        if (target == null) {
            ctx.sendError("Player not found!");
            return;
        }
        // Execute command
    } catch (Exception e) {
        ctx.sendError("An error occurred: " + e.getMessage());
        getLogger().atSevere().withCause(e).log("Command error");
    }
}

Feedback Messages

@Override
protected void execute(CommandContext ctx) {
    // Always provide feedback
    ctx.sendMessage("Processing...");

    // Do work

    // Report result
    if (success) {
        ctx.sendSuccess("Operation completed!");
    } else {
        ctx.sendError("Operation failed: " + reason);
    }
}

Troubleshooting

Command Not Found

  1. Verify command is registered in setup()
  2. Check command name doesn't conflict with existing commands
  3. Ensure plugin is loading correctly

Permission Denied

  1. Check player has the auto-generated permission
  2. Verify custom permission is granted
  3. Check permission node spelling

Arguments Not Parsing

  1. Verify argument order matches usage
  2. Check ArgType matches expected input
  3. Ensure required arguments are provided

Tab Completion Not Working

  1. Verify argument has suggestions defined
  2. Check completion returns non-empty list
  3. Ensure partial matching is implemented

Detailed References

For comprehensive documentation:

  • references/argument-types.md - Complete argument type reference with all ArgTypes, parsing, validation
  • references/command-patterns.md - Advanced patterns: cooldowns, confirmations, pagination, wizards

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Cursor

29.08%
按下载量换算35

Claude Code

22.76%
按下载量换算27

github-copilot

17.73%
按下载量换算21

mcpjam

12.22%
按下载量换算15

zencoder

6.53%
按下载量换算8

crush

2.93%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills