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

Why isn't addSound working?

Comments in 'Plugin Development' started by BlubberBoy333, Jul 13, 2015.

  1. MrGenga
    Offline

    MrGenga Active Member

    Joined:
    Jul 24, 2015
    Posts:
    75
    Minecraft User:
    MrGenga
    Use this:
    PHP:
    $level->addSound($sound, [$players]);
    The second argument must to be an array of players.
  2. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Good old times :D, this post would not be here if i had learned php oop :D.
  3. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Must???
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Yes, or just don't pass that argument to use the default value (players who are using that chunk)
    SeifValkierks and jojoe77777 like this.
  5. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    $event->getPlayer()->addSound(new $sound ($player), array($player));
    // Sound
    // PopSound - DoorSound - etc.....
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Wont work :p
  7. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    did you register events?
    SeifValkierks likes this.
  8. tigerza118
    Offline

    tigerza118 Active Member

    Joined:
    Jan 31, 2015
    Posts:
    100
    Minecraft User:
    tigerza117
    i am use
    PHP:
    $pk = new LevelEventPacket;   
            
    $pk->evid 1000;
            foreach(
    $this->plugin->getServer()->getOnlinePlayers() as $p){
                
    $pk->$p->getX();
                
    $pk->$p->getY();
                
    $pk->$p->getZ();
                
    $p->dataPacket($pk);
            }
    SeifValkierks likes this.

Share This Page

Advertisement