I want to use a Countdown in function so here is my Example: PHP: public function GameTask($ticks/*or else xD*/){$this->countdown = 1;$this->countdown--;$this->getServer()->broadcastMessage("Noch ".$this->countdown);} I hope that it works , please comment with examples i want to ignore getOwner() because i hate to write getOwner() xD so plz how i can make it without create a new class
In PHP, one class can only extend one other class (or extend nothing). Due to the PocketMine class autoloader, there SHOULD only be one class per file. if you think that calling getOwner() every time is annoying, add PHP: $owner = $this->getOwner(); in the beginning will allow you to use $owner directly afterwards. As of PHP 7, you can use anonymous classes, but PocketMine doesn't officially support PHP 7 yet.