-
Notifications
You must be signed in to change notification settings - Fork 1
Handling console senders
Dalton edited this page Apr 24, 2022
·
2 revisions
Handling Console senders is done via functional interface method like so:
@CommandName(name = "help")
public class HelpCommand extends ApiCommand {
public HelpCommand(YourJavaPluginClass pluginInstance) { // If you don't want Dependency Injection, make the constructor empty
this.onConsoleSender((consoleSent) -> {
ConsoleCommandSender consoleSender = consoleSent.console();
List<String> args = consoleSent.args();
}); // You can change onPlayerSender and onTabComplete here, check usages on the sidebar
}
}
Page written by: Dalton Burchard
- Your main class and you
- Editing API Settings (Optional)
- Creating an PluginInventory
- Creating Clickable items
- (Not added yet) Examples