CommandClip

插件

· 作者 notTamion

适用于 Bukkit 插件的命令框架

0 本站下载 0 关注 更新于 2 年前

最新 1.1.0 · 1.20.4 · Bukkit / Paper

一键开服(送7天)

CommandClip

Bukkit 插件的命令框架

依赖

Gradle
repositories {
    mavenCentral()
}

dependencies {
    compileOnly("io.github.nottamion:commandclip:1.1.0")
}
Maven
<dependency>
    <groupId>io.github.nottamion</groupId>
    <artifactId>commandclip</artifactId>
    <version>1.1.0</version>
</dependency>

为了减小你插件的文件体积,建议让 Spigot 为你下载该框架。这也意味着你无需将框架阴影打包(shade)到你的插件 JAR 中。

plugin.yml
libraries:
  - io.github.nottamion:commandclip:1.1.0

用法

文档目前正在构建中,请访问 。

目前请先查看下面的示例。

这是一个利用基本功能的示例:

new BaseCommand("hello", this)
    .subCommand(new SubCommand("there")
        .executes((commandSender, s, strings) -> {
            commandSender.sendMessage(s + " there " + strings[0]);
        })
        .tabCompletes((commandSender, s, strings) -> strings.length == 1 ? Bukkit.getOnlinePlayers().stream().map(Player::getName).toList(): List.of())
        .testArgs((commandSender, s, strings) -> {
            if (strings.length != 1)
                return "Please provide a valid playername";
            if (!Bukkit.getOnlinePlayers().stream().map(player -> player.getName()).toList().contains(strings[0]))
                return "Player is not online";
            return null;
        })
        .permission("hello.there", "You aren't allowed to get a Welcome :("))
    .alias("hi")
    .commandDescription("Welcomes you")
    .commandPermission("hello")
    .register();

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源