Annotation And Sub Command
Please make sure you have read the Quick Start before the continuous reading.
Annotation
Here's the annotation of command
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Commander {
String name(); // command name (compulsory)
String description(); //command description (compulsory)
boolean playerOnly() default false; // command is only player
String permission() default ""; // command permission
String[] alias() default {}; // command alias
}playerOnly will not auto cast CommandSender into Player type,you still need to cast it manually.
Sub Command Structure
With this framework, create infinity sub commands are extremely easy.
最后更新于