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

Hiding system messages

Comments in 'General Discussion' started by adamascj, Nov 22, 2014.

  1. adamascj
    Offline

    adamascj New Member

    Joined:
    Jun 25, 2014
    Posts:
    39
    Minecraft User:
    Americo
    It appears that Lifeboat servers have hided the system messages ( "x joined the game","y has left the game" etc.) . For a server having many players is a very good thing. How can I do it?
    Last edited: Nov 22, 2014
  2. SpiderPig
    Offline

    SpiderPig Active Member

    Joined:
    Sep 21, 2013
    Posts:
    128
    Minecraft User:
    SpiderPig
    Edit the source or make a plugin that removes them
  3. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    I'm working on a plugin to hide or customize it :)
    Last edited: Nov 24, 2014
  4. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    public function onJoin (PlayerJoinEvent $ev){
    $ev->setJoinMessage(" ");
    }

    public function onQuit(PlayerQuitEvent $ev){
    $ev->setQuitMessage(" ");
    }
    RekkuzaRage, xFlare and Tethered_ like this.
  5. adamascj
    Offline

    adamascj New Member

    Joined:
    Jun 25, 2014
    Posts:
    39
    Minecraft User:
    Americo
    Thanks Joshua. EvolSoft - good to know it.
  6. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    :)
    xFlare likes this.
  7. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    Awesome cant wait to see it. I can make one two but I'm not good with config files yet. I'm still learning them :D
  8. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    haha works perfect xD thanks
  9. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    you could also modify the join and quit message :D

    example:

    $ev->setJoinMessage($ev->getPlayer()->getName() . " joined.");
    Last edited: Nov 25, 2014
  10. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    public function onJoin (PlayerJoinEvent $ev){
    $ev->setJoinMessage('');
    }
    public function onQuit(PlayerQuitEvent $ev){
    $ev->setQuitMessage('');
    }
    public function onDeath(PlayerDeathEvent $ev){
    $ev->setDeathMessage('');
    }

    now the chat is fine xD dont want see the messages ^^
  11. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    The code is correct. Have you implemented the Listener?
  12. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    He has to implement the listener other wise the plugin wont build in DevTools. He said it works so I think he did. ;)
    EvolSoft likes this.
  13. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
  14. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    Hmm not working for me?
    PHP:
    <?php

    namespace xFlare\SFBConfig;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\event\player\PlayerJoinEvent;
    use 
    pocketmine\Player;
    use 
    pocketmine\event\player\PlayerQuitEvent;
    use 
    pocketmine\event\player\PlayerDeathEvent;
    use 
    pocketmine\Server;
    use 
    pocketmine\event\Listener;

    class 
    Main extends PluginBase implements Listener {
        public function 
    onJoin (PlayerJoinEvent $ev){
            
    $ev->setJoinMessage('');
            return 
    true;
        }
        public function 
    onQuit(PlayerQuitEvent $ev){
           
    $ev->setQuitMessage('');
           return 
    true;
       }
       public function 
    onDeath(PlayerDeathEvent $ev){
        
    $ev->setDeathMessage('');
        return 
    true;
    }

    ?>
  15. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    you didnt register the events on public function onEnable() :p
    EvolSoft, xFlare and Xenturio like this.
  16. PixelGuy75
    Offline

    PixelGuy75 Notable Member Plugin Developer

    Joined:
    Feb 9, 2014
    Posts:
    316
    Plugins:
    2
    Minecraft User:
    PixelGuy75
    How would you make it so the message would come from a config?
  17. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    Add some code to generate a config then add some if/else properties.
  18. PixelGuy75
    Offline

    PixelGuy75 Notable Member Plugin Developer

    Joined:
    Feb 9, 2014
    Posts:
    316
    Plugins:
    2
    Minecraft User:
    PixelGuy75
    Ok
  19. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Using a YAML file to store it...
    PHP:
    public $config = new Config($directory_to_the_config "Messages.yml"CONFIG::YAML//You could use $this->getDataPath(); as the $directory

    //Assuming that you know how to work with YAML files and you already assigned the key values...

    public function onPlayerJoin(PlayerJoinEvent $event){
         
    $event->setJoinMessage($this->config->get("join")); //You should assign the join message to the key "join" in this case
    }

    public function 
    onPlayerQuit(PlayerquitEvent $event){
         
    $event->setQuitMessage($this->config->get("quit")); //You should assign the quit message to the key "quit" in this case
    }
    xFlare likes this.
  20. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    What do you mean by key values?

Share This Page

Advertisement