import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class Commands implements CommandExecutor {
/*
When making a plugin with a command, you always use the function below. The onCommand function
contains everything you need to make a command.
*/
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(command.getName().equalsIgnoreCase("hello")) {
//Above is the name of the command
sender.sendMessage(ChatColor.GREEN + "Why hello there " + sender.getName());
/*
This will send a message to the person who sent the command. The message will be
Why hello there and then the players name, and it will be in green.
*/
}
return true;
}
}
(Using IntelliJ)