View attachment 15931this is literally for a plugin that says bruh to you, reloads a configuration file, and sends an about message.
I do not know why I was mentioned like 8 times by people just because they found a developer on here, but since I'm already on this thread I'll just give some tips.
First off, just by looking at this for one second, you should get a Utils class, it will save you LOADS of time. Most importantly, a sendMessage util. You can make one like this:
Java:
public static void sendMessage(Player player, String message) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', message));
}
public static void sendMessage(CommandSender sender, String message) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', message));
}
Make one for a Player object, and a CommandSender object. You can access these in any class like this:
Java:
player.sendMessage("&cYou don't need to put ChatColor.translate in here!");
sender.sendMessage("&a&lVery quick and speedy.");
Secondly, its always best to move your commands to a separate class. I like creating my commands under a new package just called "commands", and every class name is like this: <name>Command.class. For instance, a bruh command would be BruhCommand.class.
this way you can have your commands isolated and keep your main class nice and organized.
Third, if you are only making one command per class, you don't need to check if the command name/label is that command. You can just jump to it like this:
Java:
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length < 1) {
// code
}
return true;
}
The last thing I can see there is just to organize your code a little bit more. Your if else statements are a bit messy and could be cleaned up, which in the future when making larger plugins could help drastically with speed.