HomeJavaModsJubeCommandFramework
How to install:
1. Stop your server
2. Put JubeCommandFramework into your plugin folder
3. You can start you server again

How to use as Developer:
1. Add the JubeCommandFramework to your plugin
2. Add a depend statement in your plugin.yml
Code (Text):
name: YourPluginName
version: 1.x
main: de.yourname.YourMain
author: You

depend: ["JubeCommandFramework"]
3. Instead of your MainClass extending JavaPlugin you extends CommandFramework
Code (Text):
public class Main extends JavaPlugin {} // WRONG

public class Main extends CommandFramework {} // RIGHT
4. Now you can create your commands an add it to the CommandFramework.

How to create a command:
1. Don't implement CommandExecutor
2. Choose CommandType:
- extends Command => Console or Player [de.jubeki.cmdframework.Command]
- extends PlayerCommand => only Player
- extends ConsoleCommand => only Console
3. Write in the constructor super("<commandname>") your commandname.
4. Set messages and other options via setOption(...) (for more information look below)
5. register your command in your Main-Class:
Code (Text):
registerCommand(Command);
How to create a subcommand:
(more detailed Instructions will follow, because I want to fix a little argument problem first.)
- use addSubCommand(Command) to add an subcommand

Which options can I set:
- setMaxArgs(int) => maximal Argument length (-1 is infinite)
- setMinArgs(int) => minimal Argument length
- setDescription(String) => sets the Description
- setUsage(String) => what should follow after the command
- setLabel(String[]) => what labels should the command have
- setPermissions(String[]) => what permission is needed to perform the command (the player needs only one of the permissions)
- setNoPermissionsMessage(String) => What should be sent when the player doesn't have permissions

TabComplete:
- First of all you can tab subcommands.
- When there are no more subcommands then the command own Strings are given.
- with setTabComplete(String[][]) you can say for each argument length what should be tabbed.
for example:
Code (Text):
setTabComplete(new String[] {"%player"})
Then the player can tab all online Players.
Other replacers: "%loc", "%locX", "%locY", "%locZ", "%locWorld"

If you put into the tabcompleter a String which is not given it will be added as it is. for example "set", "add", "remove", ...

you can also add your own replacers:
simply overwrite the replaceOnTabComplete(CommandSender, String, String[])


If you need help with the plugin you can ask me for help.
If you have nice ideas or find a bug please write me a private message.

For more information and more things you can look into the sourcecode.
If you want to change it download the sourcecode and you can use it as your own. I only want to get credit for my work therefor the Licence!


~Jubeki

What will come:
- CommandSplitter: (splits command per arguments length)
args.length == 1 => Command1
args.length == 2 => Command2
args.length == x => CommandX

Plugin details

Read from the plugin's own plugin.yml.

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.

JubeCommandFramework is a free Minecraft Java mod. Compatible with Minecraft 1.10. Downloaded 73 times (via Spigot). Download it and open it directly in the game.

Explore more