|
### 1. use template "CommandNew"
|
|
### 1. use template "CommandNew"
|
|
|
|
|
|
### 2. fill constructor with your keyword and number of params
|
|
### 2. Rename "CommandNew to "Command<YourName>"
|
|
|
|
|
|
|
|
### 3. fill constructor with your keyword and number of params
|
|
```java
|
|
```java
|
|
public CommandNew()
|
|
public CommandNew()
|
|
{
|
|
{
|
... | @@ -9,15 +11,15 @@ public CommandNew() |
... | @@ -9,15 +11,15 @@ public CommandNew() |
|
super.helptText = "help.your-keyword";
|
|
super.helptText = "help.your-keyword";
|
|
}
|
|
}
|
|
```
|
|
```
|
|
### 3. in execute method implement your code after the `isValid()` check
|
|
### 4. in execute method implement your code after the `isValid()` check
|
|
|
|
|
|
Note:
|
|
Note:
|
|
- `command[0]` is the commandname, `command[1]` ist the first useabel paramater
|
|
- `command[0]` is the commandname, `command[1]` ist the first useabel paramater
|
|
- you can use `bundle.getController().print(message);` to print a result to the console
|
|
- you can use `bundle.getController().print(message);` to print a result to the console
|
|
- if you have to enter custom variables in the command you have to pass them via the `CommandBundle`
|
|
- if you have to enter custom variables in the command you have to pass them via the `CommandBundle`
|
|
|
|
|
|
### 4. add your Command to `PossibleCommands`
|
|
### 5. add your Command to `PossibleCommands`
|
|
|
|
|
|
### 5. implement help text in `_en.properties` !IMPORTANT
|
|
### 6. implement help text in `_en.properties` !IMPORTANT
|
|
|
|
|
|
For additional examples look into included standard commands (list, help, clear) |
|
For additional examples look into included standard commands (list, help, clear) |