Inside main file? Yes PHP: // Main.phpnamespace some\name\space;class Main extends PluginBase {}class Timer extends PluginTask {}
No. If you put a class not in a file with its name, strange things may happen. You can do it right without crashing, but any plugins that do this will not be approved on the forums, and in the future may not work.
And lets put this together: How to implement task in the main file, under main class? PHP: // Main fileclass Main extends PluginBase {}/** Under the Main class*/
you know, it is quite irresponsible just to answer the question without pointing out its problems, since future readers may think that this will become a solution.
What about BasicHUD? https://github.com/Muirfield/pocketmine-plugins/blob/master/BasicHUD/src/aliuly/hud/Main.php#L49-L69
Technically it isn't even in the main class, your just initiating another class within the main file.
Blame @Humerus. From what I heard from @shoghicp, this should not be allowed. Too lazy to find citation for that.