Hide Commands

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

  1. neb16

    neb16 Spider

    Messages:
    6
    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 Wither Skeleton

    Messages:
    1,472
    GitHub:
    HimbeersaftLP
    See my reply to this post:
     
  3. Kkora

    Kkora Baby Zombie

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

    neb16 Spider

    Messages:
    6
    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 Baby Zombie

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

    Kkora Baby Zombie

    Messages:
    167
    GitHub:
    kkora2k3
    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 Slime

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

    HimbeersaftLP Wither Skeleton

    Messages:
    1,472
    GitHub:
    HimbeersaftLP
    corytortoise and Edwardthedog2 like this.
  10. JinKaidoMC

    JinKaidoMC Spider

    Messages:
    13
    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:
    5
    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);
    }
    }
     

Share This Page

  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.