-
Notifications
You must be signed in to change notification settings - Fork 1
CMDPass
Marcin Grzywacz edited this page Nov 5, 2022
·
3 revisions
This annotation passes execution to another class that handles things it's way
@CMDPass("path.to.command.class")
Path to command class is relative to plugin main class package
WARNING You can create infinite loops that will surely crash the server during initialization
Given the following project structure
Usage:
package com.lupus.tester.commands
class TestCMD {
@CMDPass("AnotherTestingCMD")
fun run(ex: CommandSender, value: Int) {
}
}
package com.lupus.tester.commands
class AnotherTestingCMD(val previousValue: Int) {
fun run(player: Player, a: Int): String {
return "Your numbers were $a and $previousValue"
}
}
Gives following output
You could also add @Continuous
annotation in AnotherTestingCMD
class for the simpler every subcommand will apply /test run 10 run 100
- Maven installation
- Using in java
- Initializing commands
- I18n
- Annotations
- Additional
- Errors