百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

commodore

> 编程语言
开源

用于在 Bukkit 插件中使用 Minecraft 1.13 的"brigadier"库的工具。

192 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于在 Bukkit 插件中使用 Minecraft 1.13 的"brigadier"库的工具。

commodore

commodore is a utility for using Minecraft's 1.13 brigadier library in Bukkit plugins. It allows you to easily register command completion data for your plugin's commands.

If you have questions, feel free to ask in Discord.

Example


Approaches to registering completion data

commodore supports:

  • Registering completions using brigadier's LiteralCommandNode builder API
  • Registering completions using commodore's .commodore file format

For example, implementing completions for Minecraft's /time command:

Using brigadier's LiteralCommandNode builder API

…

Using commodore's .commodore file format

time {
  set {
    day;
    noon;
    night;
    midnight;
    time brigadier:integer;
  }
  add {
    time brigadier:integer;
  }
  query {
    daytime;
    gametime;
    day;
  }
}
java
// assuming the file above is stored as "time.commodore" in the plugin jar
LiteralCommandNode timeCommand = CommodoreFileFormat.parse(plugin.getResource("time.commodore"));
commodore.register(bukkitCommand, timeCommand);

Using the .commodore file format is recommended. In my opinion it is much easier to read/understand/update than the Node Builder API provided by brigadier.

Another example of a .commodore file can be found here, for the LuckPerms plugin commands. The corresponding code used to register the completions is here.

Usage

This guide assumes your plugin is built using Maven or Gradle though.

1) Configure your build script to shade commodore into your plugin jar

Maven

You need to add (or merge) the following sections into your pom.xml file.

…

Gradle

You need to add (or merge) the following sections into your build.gradle file.

gradle
plugins {
  id 'com.github.johnrengelman.shadow' version '6.1.0'
}

repositories {
  mavenCentral()
  maven { url 'https://libraries.minecraft.net/' }
}

dependencies {
  /* vvv Replace with the latest commodore version vvv */
  implementation 'me.lucko:commodore:{version}'
}

shadowJar {
  dependencies {
    exclude(dependency('com.mojang:brigadier'))
  }
  
  /* vvv Replace with the package of your plugin vvv */
  relocate 'me.lucko.commodore', 'com.yourdomain.yourplugin.commodore'
}

Replace {version} with the latest version:

2) Setup commodore in your plugin

…

The com.mojang.brigadier packages will be automatically imported into your classpath when you add the commodore dependency, but they should not be shaded into your plugins jar file.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言