Hi guys, I was thinking about something... Can we remove the predicated commands on server? If we can, how can I do this? Have a nice day, bye Image Exemple: http://hpics.li/b6db63f
I don't think there is a way to do this as of now, but you can change the permissions so that fewer people can use them
You could try to send an AvailableCommandsPacket to the players which contains only the commands you want the players to see.
https://github.com/pmmp/PocketMine-...8fe582c48ee73c/src/pocketmine/Player.php#L509 Perhaps our mighty lord and savior dktapps could explain it to you, I just know you have to send the available commands serialized (?) as json.
No, he meant Predicated. If you look at the definitions, Predicated means to "be the base of" or "affirmed or asserted" commands. He is basically saying the commands that are the base commands for Pocketmine.
I am pretty sure he mean "predicted" He wants to change the commands that the MCPE client (or in this case the server) "predicted".
Oh man, I remember my kindergarten life, when we were taught the difference between subject and predicate. Back to the topic.. Send an empty array of json encoded commands packet to the player (AvailableCommandsPacket). But that'll let you not use "/" commands anymore I guess. PHP: public static function unsendCommandData($player){ $pk = new AvailableCommandsPacket(); $data = new \stdClass(); $pk->commands = ''; $commands = []; //$commands = ['help' => 0]; help command will be in the list of predicted cmds. foreach(Server::getInstance()->getCommandMap()->getCommands() as $command){ if (isset($commands[$command->getName()])) { $data->{$command->getName()}->versions[0] = $command->generateCustomCommandData($player); } } $pk->commands = json_encode($data); $player->dataPacket($pk); }
We never learned that. But if I remember right, predicate is like a verb right? It's when your doing something? And subject is a noun.
copy it to your plugin and use PHP: public function onJoin(PlayerJoinEvent $e){ $player = $e->getPlayer(); $this->unsetCommandData($player);}
For real!? Better use PHP: self::unsetCommandData($player); //if the function is within the class It's static for a reason, give it a static look