I was wondering how you would set the player count and if it is possible to set it to anything I want (Something other than the online players / max players). I've read other threads talking about this and was wondering if anyone could provide some examples of how to do it. Thanks!
I'll test this, wouldn't you have to create a query in order for the event to trigger or does it get called by PM on startup?
I'm just guessing, but PocketMine probably triggers a QueryRegenerateEvent every few seconds or when someone pings....? So when that happens, before it gets sent to the client, edit the event to change player count.
Just checked docs, here's some example code: PHP: public function queryRegen(QueryRegenerateEvent $ev){$ev->setPlayerCount(50);} That will make the client think the player count is 50.
You are right but QueryRegenerateEvent will trigger it self in a few ticks. You know, these are cheating player counts...
I'm not cheating player counts, I want to know how to combine them from multiple servers and apply color to them
You can use $server->getQueryInformation()->setPlayerCount() too. PHP is not JavaScript. You need semicolons to terminate statements.
Statements. A single statement, a.k.a. "line of code", can actually span across several lines, like this: PHP: $effect = Effect::getEffect(Effect::JUMP) ->setDuration(0x7FFFFF) ->setAmplitude(1) ->setVisible(false);
Not that they are "not necessary", but they are the same statement. The set*** functions in Effect return $this. We call another method upon the object, but we are still using the return value from the previous function. They are still the same statement. You can strip out the spaces and line breaks and put the on the same line. Line breaks make no difference on PHP.