Code:java

@Command ( aliases = { "hello" , "hey" } , desc = "Says hello" , usage = "[player] - The player to say hello to" , min = 1 , max = 1 ) public static void hello ( final CommandContext args, CommandSender sender ) throws CommandException { Player target = Bukkit. getPlayer ( args. getString ( 0 ) ) ; //0 is the index if ( target == null ) throw new CommandException ( "Player " + args. getString ( 0 ) + " not found!" ) ; target. sendMessage ( "Hello!" ) ; }