# CommandClip [](https://github.com/notTamion/CommandClip/actions) [](https://central.sonatype.com/artifact/io.github.nottamion/commandclip/overview)
一个 Bukkit 插件的命令框架
## 依赖
##### Gradle
```kotlin
repositories {
mavenCentral()
}
dependencies {
compileOnly("io.github.nottamion:commandclip:1.1.0")
}
```
##### Maven
```xml
io.github.nottamion
commandclip
1.1.0
```
为了减小插件的文件大小,建议让 Spigot 帮你下载框架。 这也消除了将框架内嵌到你的插件 jar 中的需要。
##### plugin.yml
```yaml
libraries:
- io.github.nottamion:commandclip:1.1.0
```
## 用法
文档目前正在 https://github.com/notTamion/CommandClip/wiki 构建中。
现在,请查看下面的示例。
这是一个利用基本功能的示例:
```java
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();
```