Broadcasting

Discussion in 'Plugin Development' started by rob1998@, Jun 7, 2012.

Thread Status:
Not open for further replies.
  1. what's the code for broadcasting to all online players?
     
  2. Offline

    Njol

  3. I have done that, but on the JavaDocs I don't know wich one it is and on the forums I didn't find anything.
     
  4. Offline

    Njol

    There's only two methods starting with broadcast, one which only takes a String 'message' as argument, and one which takes 2 Strings, 'message' and 'permission'. It shouldn't be too difficult to figure out which one to use ;)
     
  5. Offline

    caldabeast

    Njol
    Out of curiosity, would there be anything wrong with using the following method instead:
    Code:
    for(Player plr : Bukkit.getOnlinePlayers()){
        //check permissions and such
        p.sendMessage("BROADCAST");
    }
    This what I have always used because I feel it gives me better control.
    (Also that broadcastMessage() likes to throw errors on my server for no reason...)
     
  6. Offline

    Njol

    It should do the same, except that the console doesn't recieve the message as well as you only send it to players.
     
Thread Status:
Not open for further replies.

Share This Page