Skip to content

Command basics

Berke Akçen edited this page Jan 3, 2025 · 19 revisions

Table of Contents

Getting Started with Command Framework

The project isn't in the Central Repository yet, so you'll need to specify a repository.
To add this project as a dependency, include the following in your pom.xml:

Adding Command Framework as a Dependency

Maven Dependency

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
<dependency>
    <groupId>com.github.Despical</groupId>
    <artifactId>CommandFramework</artifactId>
    <version>1.5.13</version>
</dependency>

Gradle dependency

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation 'com.github.Despical:CommandFramework:1.5.13';
}

Basic Command Parameters

This section outlines the essential parameters you can use to define commands within the Command Framework.
Each parameter allows for customization of command behavior and usage.

Parameter Return Type Optional Description
name String FALSE Name of the command
fallbackPrefix String TRUE A prefix which is prepended to the command with a ':' one or more times to make the command unique.
permission String TRUE Permission required to execute the command
aliases String Array TRUE Alternative names for the command
desc String TRUE Brief description of the command
usage String TRUE How to usage the command
min Integer TRUE Minimum number of required arguments
max Integer TRUE Maximum number of required arguments
onlyOp Boolean TRUE Whether only operator (op-ed) players can run
this command
async Boolean TRUE If true, executes the command in a new thread, preventing main thread blockage. Ideal for time-consuming tasks.
senderType SenderType TRUE Type of sender (e.g., BOTH, PLAYER, CONSOLE)