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

Solved Disable command output to non-ops.

Discussion in 'Development' started by JUSTaMod, Nov 16, 2018.

  1. JUSTaMod

    JUSTaMod Spider Jockey

    Messages:
    38
    GitHub:
    justamod
    The general gist of what I'm trying to do - I'm trying to look into a way to disable output of commands run as a player, with exceptions of certain commands.

    What sparked me trying to attempt this was a plugin called Festival - which allows players to "run" commands as op when the enter a certain area. However I didn't want them to see the output of the command on their screen. I want them to have no idea that they ran the /effect command on themselves when they entered/left that area.

    But, I was also wondering if this can be extended further - lets say a player tries to run /op - they get the message "no permissions" (or something.) Can a plugin get rid of that?

    But obviously the /help command should still give an output and /list and...

    Thanks for the help.
     
  2. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
  3. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    That has nothing to do with what OP was asking...


    You can accomplish this by unregistering the pocketmine-provided commands and recreating the classes without using the sendMessage() function. Make sure to register the new commands :D
     
    corytortoise likes this.
  4. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    The title says command output.
     
  5. HeyDeniis_

    HeyDeniis_ Baby Zombie

    Messages:
    137
    Use the PlayerCommmandProcessEvent and Set the command in $event->setCancelled(true);
     
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Yea, I don't know 100% what OP is asking but I can make a reasonable guess that the output they want to disable is the message that follows when the command is run, not the command itself. OP said the following quotes which implies that they don't want the effects of the command disabled.
     
  7. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    Not really sure I see the point of using commands in the bg instead of just adding an effect directly. Using commands to do this is immensely inefficient.
     
    jasonwynn10 likes this.
  8. JUSTaMod

    JUSTaMod Spider Jockey

    Messages:
    38
    GitHub:
    justamod
    @dktapps I was thinking about that after I posted this. It's really quickly going to make a mess of the server. I'm looking into doing that instead, so I'll mark this as solved.

    I need to figure out PHP so I can stop asking these damn questions that don't really make sense. :|
     
    jasonwynn10 and dktapps like this.
  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.