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

Hide Commands

Discussion in 'Requests' started by neb16, Dec 14, 2018.

  1. neb16

    neb16 Witch

    Messages:
    71
    GitHub:
    developerneb101
    Hello, I was wondering if it is possible to make a plugin that completely removes certain commands from even showing up to certain player groups.
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    See my reply to this post:
     
  3. Kkora

    Kkora Baby Zombie

    Messages:
    189
    GitHub:
    shisui203
    Find an plugin on Google.com called: HelpModifier.
    Use it permissions.
     
  4. neb16

    neb16 Witch

    Messages:
    71
    GitHub:
    developerneb101
    I dont want the help command to disappear, I want a config where it will hide certain commands from certain groups
     
  5. Destroyer57

    Destroyer57 Zombie

    Messages:
    275
    i dont think that this works
     
  6. Kkora

    Kkora Baby Zombie

    Messages:
    189
    GitHub:
    shisui203
    no. HelpModifier will hide command and you'll need to insert your command.
    And if you wanted to hide with some certain group, use it permissions.
     
  7. BLOCKSTORM

    BLOCKSTORM Witch

    Messages:
    67
    That is really easily possible. small example:
    PHP:
    $command $this->getServer()->getCommandMap()->getCommand("COMMAND NAME HERE")->setPermission("an_permission");
    Only if the player has the permission "an_permission", command "COMMAND NAME HERE" will be shown to him
     
  8. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    He's requesting a plugin not a code line.
     
  9. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    corytortoise and EdwardHamHam like this.
  10. JinKaidoMC

    JinKaidoMC Creeper

    Messages:
    5
    GitHub:
    kaidoMC
    if use command block then use command /gamerule commandoutput false
    else
    if use plugin then unphar this plugin and edit src in $sender->sendMessage
    I think this post will good for you
     
  11. DragonBoy

    DragonBoy Creeper

    Messages:
    4
    GitHub:
    DragonBoyHD
    public function Commands(PlayerCommandPreprocessEvent $event) {
    $cmd = explode(" ", strtolower($event->getMessage()));
    //ejemplo the command
    if($cmd[0] === "/gamemode"){
    if(/7check Rank player)
    if is no true permisson $event->setCancelled(true);
    if is true permisson $event->setCancelled(false);
    }
    }
     
  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.