How to play jukebox music for all players.

Discussion in 'Plugin Development' started by DSCxSander, Nov 24, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    DSCxSander

    Hey dear!

    I'm wirte a plugin for my server (Cristmas update)
    And i have a texturepack edit with christmas music.

    But i want to make a command (example: /music christmas)
    Cristmas is the music disc Blocks.

    What i want = if i do /music christmas
    That the server plays "blocks" for all the online players.

    Is there a anywy for?

    Sorry for my bad english,

    Sander
     
  2. Offline

    mrCookieSlime

    DSCxSander
    Just loop through all Players and then just play the music disc using playEffect():
    player.playEffect(player.getLocation(), Effect.RECORD_PLAY, Material.RECORD_3);
     
  3. Offline

    DSCxSander

    Thnxs! But how can i stop the music?
     
  4. Offline

    mrCookieSlime

    DSCxSander
    Previously (before the 1.7 Update changed the Sound System) you were able to simply use
    player.playEffect(player.getLocation(), Effect.RECORD_PLAY, Material.AIR);
    but since 1.7 this is no longer possible as far as I know.
     
  5. Offline

    DSCxSander

    Nope, i test it, But how can i stop it now?
     
  6. Offline

    mrCookieSlime

    DSCxSander
    As I said, this no longer works. There is no way to stop it as far as I know.
     
Thread Status:
Not open for further replies.

Share This Page