Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to hide a command? Example /effect

Comments in 'Plugin Development' started by M4nt0s, Apr 20, 2016.

  1. M4nt0s
    Offline

    M4nt0s Active Member

    Joined:
    Sep 15, 2015
    Posts:
    49
    Minecraft User:
    M4nt0s
    As Example /effect

    How to hide it that not all Player see that i give me a speed effect.
  2. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    I believe only OPs will see that you gave yourself an effect. Normal players can only tell by your particles.
    applqpak likes this.
  3. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
  4. M4nt0s
    Offline

    M4nt0s Active Member

    Joined:
    Sep 15, 2015
    Posts:
    49
    Minecraft User:
    M4nt0s
  5. M4nt0s
    Offline

    M4nt0s Active Member

    Joined:
    Sep 15, 2015
    Posts:
    49
    Minecraft User:
    M4nt0s
    You meen that only op can see the Message when i give me or an other Player an effect.
    applqpak and HotFireyDeath like this.
  6. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    yes -.-
  7. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    ENGLISH.

    already said
  8. andre_the_gamer
    Offline

    andre_the_gamer Active Member

    Joined:
    Feb 5, 2015
    Posts:
    112
    Minecraft User:
    Andre_The_Gamer
    No need to modify nothing.. Just detect when the player does /effect and cancel the event.. It's just that easy there isn't a need of modifying the EffectCommand.php :)
  9. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    -.-'
  10. M4nt0s
    Offline

    M4nt0s Active Member

    Joined:
    Sep 15, 2015
    Posts:
    49
    Minecraft User:
    M4nt0s
    Ok Thanks
  11. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Only players with the permission pocketmine.command.effect will see the message. OPs gave that permission by default.
  12. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    // Nasty code below
    onCommand(PlayerCommandPreProcessEvent $e)
    {
       
    $msg $e->getMessage();
       
    $msg explode(" "$msg);
       
    $msg $msg[0];
       
    $msg substr($msg1strlen($msg));
       if(
    strtolower($msg) == 'effect'$e->setCancelled(true);
    }
  13. M4nt0s
    Offline

    M4nt0s Active Member

    Joined:
    Sep 15, 2015
    Posts:
    49
    Minecraft User:
    M4nt0s
    Thanks that is helpful
  14. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Code above might not work but this plugin works for sure ;)

    Disable commands from config.yml

    Attached Files:

Share This Page

Advertisement