https://github.com/miqhtiedev/commandmanager
A tool to help register commands using the bukkit api.
https://github.com/miqhtiedev/commandmanager
Last synced: 3 months ago
JSON representation
A tool to help register commands using the bukkit api.
- Host: GitHub
- URL: https://github.com/miqhtiedev/commandmanager
- Owner: Miqhtiedev
- Created: 2020-12-08T02:40:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-08T02:56:00.000Z (over 4 years ago)
- Last Synced: 2025-01-27T21:16:20.435Z (4 months ago)
- Language: Java
- Size: 58.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CommandManager
A tool to help register commands using the bukkit api.## What it does
CommandManager gives you the ability to register commands without even touching plugin.yml## How it does it
CommandManager makes use of reflection and adds the SubCommand to the server's command map## Installation
First add jitpack to the repo list
```gradle
repositories {
maven { url 'https://jitpack.io' }
}
```Second add CommandManager to the dependencies
```gradle
dependencies {
implementation 'com.github.Miqhtiedev:CommandManager:v1.0.0'
}
```## How To Use
In the onEnable function create an instance of the CommandManager like so
```javaprivate static CommandManager commandManager;
@Override
public void onEnable(){
commandManager = new CommandManager(this);
}
```Create a command! Make a new class that extends SubCommand and then add some code!
```java
public class CoolCommand extends SubCommand {
protected CoolCommand(String name) {
super(name);
}@Override
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
sender.sendMessage("This is cool!");
return false;
}
}
```Finally, register the command.
```javaprivate static CommandManager commandManager;
@Override
public void onEnable(){
commandManager = new CommandManager(this);
commandManager.registerCommand(new CoolCommand("cool"));
}
```