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

How to set broadcast to certain world?

Comments in 'Plugin Development' started by mclab, Jan 28, 2015.

  1. mclab
    Offline

    mclab Active Member

    Joined:
    Dec 24, 2014
    Posts:
    49
    Minecraft User:
    Dragonflex
    How to set broadcast to certain world?
  2. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Sendmessage your player
    using
    PHP:
    foreach

  3. mclab
    Offline

    mclab Active Member

    Joined:
    Dec 24, 2014
    Posts:
    49
    Minecraft User:
    Dragonflex
    Thanks!

    Code for all

    PHP:
    public function onPlayerJoin(PlayerJoinEvent $event){
            
    $player $event->getPlayer();
            
    $name $player->getDisplayName();
            
    $event->setJoinMessage("");
            if (
    $player->getLevel()->getName() == "world"){
            
    $world $player->getLevel();
            
    $players $world->getPlayers();
            foreach(
    $players as $player){
            
    $player->sendMessage("$name joined !");
    }
            }
              
        }
    Edit: It can be good for Alerts per world :)
  4. Exxarion
    Offline

    Exxarion Active Member Plugin Developer

    Joined:
    Jan 5, 2014
    Posts:
    242
    Plugins:
    1
    Minecraft User:
    Notch
  5. mclab
    Offline

    mclab Active Member

    Joined:
    Dec 24, 2014
    Posts:
    49
    Minecraft User:
    Dragonflex
  6. mclab
    Offline

    mclab Active Member

    Joined:
    Dec 24, 2014
    Posts:
    49
    Minecraft User:
    Dragonflex
    To ja DragonFlex, #woooahhhh

Share This Page

Advertisement