One of the plugins I’m porting from Bukkit has a /title command. Sponge also apparently has a /title command that is being called instead of my custom command.
commands {
# A mapping from unqualified command alias to plugin id of the plugin
# that should handle a certain command
aliases=null
}
However it gives no information on what aliases actually should be in the case that the server operator needs to use it. Does anyone know how this field should be used, or any documentation that might point me in the right direction?
The title command belongs to Minecraft, not Sponge.
In short, the command alias system is that every command has a modId and commandName, so in the case of the title command, it’s minecraft:title. In this case, you’ll want to use myPlugin:title where the command name is title and the plugin’s actual id is com.myPlugin.
To actually map this correctly however, you’ll want the mapping to look like so in the config (if I’m understanding this correctly):
commands {
# A mapping from unqualified command alias to plugin id of the plugin
# that should handle a certain command
aliases= {
title: com.myPlugin
}
}
That doc was very recently written, and I’m still working on a Table of definitions to go with it - Docs PR #291
We hope to have a more detailed explanation available shortly. A working example helps greatly, thanks!
This isn’t for creating aliases, it’s defining mappings of a command to the plugin implementing it. If, for example, say you have two plugins with a /repair command.
aliases {
repair="nucleus"
}
This tells Sponge that the command /repair should be controlled by Nucleus (nucleus being the plugin id).
In your case, you’re looking to set up an alias for a command; not redirect it to a plugin. There are a couple of plugins that can handle aliases, one of which is my plugin CmdControl. There’s plenty of resources to help get you started, and I think this is what you’re looking for and then some.
As a final note, it’s generally better to create a new thread than bump really old ones - this was posted well over 2 years ago!