You can use Tasks. Tasks are always run at a set interval once scheduled. You can easily count the players in your game and run the task to update that count to players' view. See pocketmine\scheduler\Task.
Just look at what plugins have a Task for that, you can create a class in new file.php (its better) or you can create it in your Main.php or what where do you want.
Like this : PHP: private $GodWeedZao ; public function __construct(Main $GodWeedZao ) { $this->$GodWeedZao = $GodWeedZao ; } public function onRun(int $currentTick) { $this->plugin->Example();//Example is a function you created in Main.php to repeat task. }}
its better to use it on new file.php in src in your own plugin. (i didnt write class, dont forget to use it, if you dont have ide)