hCore allows you to create your custom commands without any editing plugin.yml.
Introducing
Firstly, you need to create your command class.
Example code for ready command class:
importcom.hakan.core.command.executors.base.BaseCommand;importcom.hakan.core.command.executors.placeholder.Placeholder;importcom.hakan.core.command.executors.sub.SubCommand;importorg.bukkit.Bukkit;importorg.bukkit.command.CommandSender;importjava.util.ArrayList;importjava.util.List;@BaseCommand( aliases = { "alias" } /* Aliases means like what label you need to use for this command*/, name ="example command", usage ="/customcommand", description ="This is the description of the custom command")publicclassCustomCommand { @SubCommand( permission ="needed.permission", permissionMessage ="§cYou have no perms for using this command!" )publicvoidmainCommand(CommandSender sender,String[] args) {sender.sendMessage("You used main command without any args! You also can use /alias for calling this command"); }// After executing this command sender will get message if player is currently online or offline @SubCommand( permission ="online.check", args = { "<%player%>" } )publicvoidcheckOnlineCommand(CommandSender sender,String[] args) { sender.sendMessage("Player is currently " + (Bukkit.getOfflinePlayer(args[0]).isOnline() ? "online" : "offline"));
}/* Placeholders allows you to add how many u want tab completions (in this situation is player names) */ @Placeholder( name ="player" )publicList<String> getPlayers() {returnBukkit.getOnlinePlayers().map(player ->player.name); }}
Placeholders
What is it?
Placeholders allows you to add a lot of args by using one method. So, you can add placeholder for anything you can imagine. For example: Loaded world names, Online players, Ready Values (100, 200, 300), e.t.c.
SubCommands
SubCommand means arguments. You can provide permission to use this command and noPermission message.
You can also provide placeholders, using <%placeholderName%>, and arguments.
Ending working with commands
After u created class, you need to register command. So, use the HCore#registerCommands(new YourCommandClass())