-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Awaiting releaseIssue will be resolved by the next releaseIssue will be resolved by the next releaseBaseRelated to the ConfigCommand pluginRelated to the ConfigCommand pluginenhancementNew feature or requestNew feature or request
Description
The CommandAPI offers the CommandTree class as an alternative to the CommandAPICommand when registering commands. The syntax for using it to make a command fits the syntax of a yml file, so I think a new command definition system can be built off of the CommandTree.
For example, the following yml file:
commands:
sayHi:
permission: greet
then:
permission: greet.other
name: <target>
type: Player
executes:
- do <target>.sendMessage(<sender>.toString().join(" says Hi!"))
executes:
- do <sender>.sendMessage("Hi!")would be roughly equivalent to this CommandTree:
new CommandTree("sayHi")
.withPermission("greet")
.then(new PlayerArgument("target")
.withPermission("greet.other")
.executes((sender, args) -> {
((Player) args[0]).sendMessage(sender.getName() + " says Hi!");
})
)
.executes((sender, args) -> {
sender.sendMessage("Hi");
})
.register();This new command-definition system would make it easier for users to create subcommands, and make it easier to develop new features from the CommandAPI.
Metadata
Metadata
Assignees
Labels
Awaiting releaseIssue will be resolved by the next releaseIssue will be resolved by the next releaseBaseRelated to the ConfigCommand pluginRelated to the ConfigCommand pluginenhancementNew feature or requestNew feature or request