1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How do I override the /help command?

Discussion in 'Development' started by kenygamer, Jan 17, 2018.

  1. kenygamer

    kenygamer Banned Banned

    Messages:
    106
    GitHub:
    kenygamer
    Some time ago, you could do
    PHP:
    public function onPlayerCommandPreprocess(\pocketmine\event\player\PlayerCommandPreprocessEvent $event) : void{
      
    $player $event->getPlayer();
      
    $command explode(" "$event->getMessage());

      if(
    $command === "/help"){
        
    $player->sendMessage("Overriding /help");
        
    $event->setCancelled();
       }
    }
    to override the /help command. The other way would be to unregister the command.

    Since /help is client side, what I can do?
     
  2. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    You can’t override the /help only works from console.
     
  3. EdwardHamHam

    EdwardHamHam Skeleton

    Messages:
    962
    GitHub:
    edwardhamham
    What do you mean?
     
  4. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    The override Message doesn’t show for players, only works for console.
     
  5. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    EdwardHamHam and kenygamer like this.
  6. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.