⌨️Commands
Since 1.0.0
Creating an MCCommand
import net.codersky.mcutils.general.MCCommand;
import net.codersky.clans.ClanPlugin;
public class MainClanCommand extends MCPlugin<ClanPlugin> {
public MainClanCommand(ClanPlugin plugin) {
// "awesome" will be the name of the command, "c" will be an alias.
super(plugin, "clan", "c");
// Makes this command player only, so the console can't execute it.
setSenderClass(Player.class);
}
@Override
public boolean onCommand(CommandSender sender, String[] args) {
// We get the MessagesFileHolder from our plugin and send the
// message under the "clan.noArgs" path of it to the sender.
getPlugin().getMessages().send(sender, "clan.noArgs");
}
@Override
public List<String> onTab(CommandSender sender, String[] args) {
// We just return null as no suggestions will be made by this
// specific command at this point to the sender.
return null;
}
}About setSenderClass
Registering commands
Limiting access
Last updated