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

Setting the MOTD

Comments in 'Plugin Development' started by LDX, Apr 10, 2015.

  1. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    I can't figure out how to consistently set the MOTD. I've tried handling the QueryRegenerateEvent and using $event->setServerName(). I've tried using $this->getServer()->setConfigString("motd",$motd) after every PlayerJoinEvent and PlayerQuitEvent. No luck so far. I'm beginning to think this is an MCPE problem, not PocketMine and/or plugin.
    TonyDroidd likes this.
  2. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    Try this: you might have made a typo:

    Import:
    PHP:
    use pocketmine\event\server\QueryRegenerateEvent as QRE//cba to write QueryRegenerateEvent again xD
    Main:
    PHP:
    function onQR(QRE $ev){

      
    $ev->setServerName("LDXCraft");

    }

    ;)
  3. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Whats MOTD? :D Seriously!
  4. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    The name of the server that server lists get
  5. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    That's exactly what I did.
  6. Humerus
    Offline

    Humerus Staff Member Plugin Reviewer

    Joined:
    Aug 23, 2013
    Posts:
    114
    Plugins:
    1
    I think you need to set the MOTD on the network interface. Your best bet is to try doing:
    PHP:
    $this->getServer()->getNetwork()->setName($motd);
    iJoshuaHD, PEMapModder and LDX like this.
  7. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    I'll try this in a few minutes. That sounds like it should work.
  8. xiaoq
    Offline

    xiaoq Active Member

    Joined:
    Dec 23, 2014
    Posts:
    232
    Minecraft User:
    xiaoq
    like:
    PHP:
    $motd "xxx"
    $this->getServer()->getNetwork()->setName($motd); 
    ???
  9. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,167
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    Yup
    xiaoq likes this.
  10. icsmoke
    Offline

    icsmoke New Member

    Joined:
    Jan 29, 2015
    Posts:
    13
    Minecraft User:
    icsmoke
    But, motd will awesome if we can see the players online on server too XD

    Like

    > EmCePei - Beta < [14/45]

    [14/45] is online players on server

    You can make it too?
    LDX likes this.
  11. LDX
    Offline

    LDX Notable Member Plugin Developer

    Joined:
    Oct 2, 2013
    Posts:
    1,397
    Plugins:
    14
    Here. :)

    Attached Files:

    icsmoke and asyven like this.
  12. icsmoke
    Offline

    icsmoke New Member

    Joined:
    Jan 29, 2015
    Posts:
    13
    Minecraft User:
    icsmoke
    kyaa...
    thank you very much...

Share This Page

Advertisement