An open API service indexing awesome lists of open source software.

https://github.com/mqzn/mcommands

Advanced command dispatching framework
https://github.com/mqzn/mcommands

bukkit-library command command-lib commands commands-dispatcher java java-command-dispatcher java-command-framework minecraft spigot

Last synced: 9 months ago
JSON representation

Advanced command dispatching framework

Awesome Lists containing this project

README

          

# mCommands


CodeFactor
mCommands logo

An advanced general purpose command dispatching framework
designed using OOP concepts.The library is user-friendly and provides
high performance along with a high quality of production code.

This library utilizes [Kyori Adventure](https://github.com/KyoriPowered/adventure) for
messages and text styles

so in the installation you must include the dependencies of Kyori in your project's dependencies control tool file
here's an example using build.gradle:

```gradle

dependencies {
compileOnly "net.kyori:adventure-api:4.13.1"
compileOnly "net.kyori:adventure-platform-bukkit:4.3.0"
}

```

## Installation

mCommands has its own repo in maven central
so all you have to do is like this:

```gradle
repositories {
mavenCentral()
}

dependencies {
implementation 'io.github.mqzn:mCommands-:'
}
```

## Platforms

### Common

The main platform that contain the core of the library

```gradle
implementation 'io.github.mqzn:mCommands-common:'
```

### Spigot

The spigot platform is for minecraft spigot api development

```gradle
implementation 'io.github.mqzn:mCommands-spigot:'
```

### Bungee

This bungeecord platform is for minecraft bungeecord proxy api development, allows you
to declare and register bungeecord commands.

```gradle
implementation 'io.github.mqzn:mCommands-bungee:'
```

## Wiki
If you want to learn how to fully utilize the amazing potential of this library.
you must read the wiki pages starting from [here](https://github.com/Mqzn/mCommands/wiki)
You will also need the wiki in order to make something cool like the example below:

### Code Example
Here's a quick example on how to create a command using mCommands.
```java
public final class SpigotPluginTest extends JavaPlugin {

private SpigotCommandManager commandManager;

@Override
public void onEnable() {
var cmd = Command.builder(commandManager, "test")
.info(new CommandInfo("test.perm", "Test cmd", "testis"))
.requirement(SpigotCommandRequirement.ONLY_PLAYER_EXECUTABLE)
.cooldown(new CommandCooldown(5, TimeUnit.MINUTES))
.executionMeta(
SpigotCommandSyntaxBuilder.builder(commandManager, "test")
.argument(Argument.literal("testsub"))
.execute((sender, context) -> sender.sendMessage("Test sub works !"))
.build()
)
.defaultExecutor((s, context) -> s.sendMessage("OMG NO ARGS !"))
.build();

commandManager.register(cmd);
}

}
```