OMGPIDocs

OMGPI

Source

JavaDocs

SpigotMC

Custom Commands

In OMGPI you don't have to use plugin.yml to register the commands. Even better: OMGPI provides a very easy way to create custom commands.

public class YourMainClass extends Game {
  public onEnable() {
    name = "YourGameDisplayName";
    super.onEnable();
    new OMGCommand("/name", "permission.required", "/alias1", "/alias2") {
        public void call(CommandSender s, String label, String arg1, String arg2, ...) {
            //stuff here
        }
    };
  }
}

There are 5 call() methods for each args amount (0-4), higher one calling previous, and 0 args by default sends "Not enough arguments" error. So if you override 0-arg call() then the command will require no arguments, and if you override 1-arg call() it will send errpr if there is less than 1 argument. Also there is call(sender, label, args...) method which is called along with others - use that for complete overhaul or when you use more than 4 arguments. If you want your command to require 1 argument, but still use others, use lastargscall - that is set before each call(), so you can get all argument even when overriding only 1-arg call().