public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if(label.equalsIgnoreCase("ping") || cmd.getAliases()) { sender.sendMessage("Pong!") } } How do i get the aliases of a command? PLEASE EDIT by Moderator: merged posts, please use the edit button instead of double posting.
You should use cmd.getName().equalsIgnoreCase("ping") - the name of the command stays the same no matter which alias was used.
cmd.getAliases() returns a List<String> of the commands aliases. but to expand on what Njol said, lets say for instance, you have a command called derp, with an alias of herp. If you type /herp, cmd.getName() will return "derp" because thats the name of the command. label, however would return "herp" because thats the alias that you used.