Solved Good way to play music to ALL players EVERYWHERE on the server

Discussion in 'Spigot Plugin Development' started by Azmidium, Mar 15, 2016.

  1. Hello! I have been trying to figure this out for a while, but everytime I search or google it somewhere it comes up with plugins or an API. Can someone be really kind to link me to somewhere where they talk about this or explain to me this?

    Thanks so much for taking your time to write your post short or long in advance! ;)
  2. Loop over the players and play the sound?
  3. Loop through the online players and play a sound at their location.
    • Creative Creative x 1
  4. What kind of Music do you mean?
    .nbs music? Here's the formatting for .nbs files
    If its' music from a resource pack or a jukebox song, just play the sound like mentioneded above.
  5. If they move away will this lower the volume of the audio? I would like a way to play it the same everywhere. :)
  6. No, I don't think you get how the playsound method works. Either a. read the docs or b. test it out yourself.
  7. Oh I thought you were talking about the playEffect method. Oops sorry. :)
  8. You can use this:

    Code (Text):

    //for exemple, this code reproduce NOTE_PLING for all online players in server
    for(Player p : Bukkit.getOnlinePlayers()){
        p.playSound(p.getLocation(), Sound.NOTE_PLING, 100, 1);
  9. I was hoping to find a method that worked with record and play it the same everywhere, it appears that no one has found the answer and thought I was really bad with sounds. :/
  10. Be clearer, explain in more details. I'm sure someone here can help you.
  11. Rbt


    If you play it for every player individually at the same time, it's the same thing as playing it for everyone at once.