NoteblockAPI play song for all Players

Discussion in 'Plugin Development' started by DevMax_Plg, Jun 19, 2019.

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

    DevMax_Plg

    Hey Guys,

    i am working at the moment with NoteblockAPI and so far i've got this code to play a song for one Player

    Player player = (Player) sender;
    Song song = NBSDecoder.parse(new File("plugins/LobbySys/songs/" + args[0] + ".nbs"));;
    RadioSongPlayer rsp = new RadioSongPlayer(song);

    rsp.addPlayer();
    rsp.setPlaying(true);

    But i want to Play the Musik for all Players on the Server or all Players on the World.
    How can i do this. I hope anyone can Help me.

    Kind regards

    Max
     
  2. Offline

    bwfcwalshy Retired Staff

    No idea how it gets the player, you never actually use the player variable. I guess it is used in addPlayer? If so, just loop all players and add.
     
    DevMax_Plg and KarimAKL like this.
Thread Status:
Not open for further replies.

Share This Page