HomeJavaModsBCF Command Formatter
[​IMG]

[​IMG] [​IMG] [​IMG] [​IMG] [​IMG]

[​IMG] [​IMG] [​IMG] [​IMG] [​IMG] [​IMG]

Documentation

Source Code

bcf is a Command Management tool suitable for use in Bukkit/Spigot/PaperMC, Bungeecord and Standalone console, though it may support other platforms in the near future.

It allows one to easily provide full command completion for all your commands as well as automatically resolve and marshal input from the user so your command gets the data it is expecting to get. For example if your command is expecting a player name then available players will be provided during command completion and your command method will receive the actual player object, or the command sender will receive an error explaining what the error is.

This library is inspired by aikar's Annotation Command Framework (ACF) which I used before I decided on the crazy idea of writing my own to support some extra features I felt I desperately needed for some reason. The name bcf is used in recognition of that.

It was originally created for minecraft projects but now supports standalone console apps as you can see below.

[​IMG]

Features

Quickstart
  1. Add the following Maven repository to your pom.xml

    Code (Text):

    <!-- Bundabrg's Repo -->
    <repository>
       <id>bundabrg-repo</id>
       <url>https://repo.worldguard.com.au/repository/maven-public</url>
       <releases>
           <enabled>true</enabled>
       </releases>
       <snapshots>
           <enabled>false</enabled>
       </snapshots>
    </repository>  
     

  2. Add the following dependency to your pom.xml (check github for latest version)

    Code (Text):

    <dependency>
       <groupId>au.com.grieve.bcf</groupId>
       <artifactId>bukkit</artifactId>
       <version>1.3.0</version>
       <scope>provided</scope>
    </dependency>
     

  3. Shade the library into your own code by adding in your pom.xml

    Code (Text):

    <build>
       <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-shade-plugin</artifactId>
               <version>3.2.3</version>
               <executions>
                   <execution>
                       <phase>package</phase>
                       <goals>
                          <goal>shade</goal>
                       </goals>
                   </execution>
               </executions>
               <configuration>
                   <relocations>
                       <relocation>
                           <pattern>au.com.grieve.bcf</pattern>
                           <shadedPattern>${project.groupId}.${project.artifactId}.bcf</shadedPattern>
                       </relocation>
                   </relocations>
               </configuration>
           </plugin>
       </plugins>
    </build>
     
  4. Create a command class that extends BukkitCommand

    Code (Text):

    @Command("mycmd")
    public class MainCommand extends BukkitCommand {

       @Arg("list")
       public void doList(CommandSender sender) {
           sender.spigot().sendMessage(
               new ComponentBuilder("Reached List").color(ChatColor.GREEN).create()
           );
       }
    }
     
  5. Create a new CommandManager in your plugin, passing your plugin as a parameter and register your commandclass.

    Code (Text):

    // Setup Command Manager
    bcf = new BukkitCommandManager(this);

    // Register Commands
    bcf.registerCommand(new MainCommand());
     
  6. You should now be able to use /mycmd list in-game.
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

BCF Command Formatter is a free Minecraft Java mod. Compatible with Minecraft 1.13, 1.14, 1.15, 1.16 and newer. Downloaded 801 times (via Spigot). Download it and open it directly in the game.

Explore more