on player join

Discussion in 'Bukkit Help' started by Naruchico, Jan 23, 2013.

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

    Naruchico

    trying to figure out the code I should write to only say the join message to the online players, instead of the joining player...

    currently using event.setJoinMessage which broadcast to everyone.
     
  2. Offline

    JWhy

    Disable the vanilla join message, get the list of all players, remove the joining player from the list and iterate through it broadcasting your message.
     
  3. Offline

    Naruchico

    thanks, I figure as much, just finally figured out how to write that a second ago lol

    ugh seems I still done get it -_-

    this is what I got so far
    Code:
    public class NameAnnouncerListener implements Listener {
        @EventHandler(priority = EventPriority.NORMAL)
            public void onPlayerJoin(PlayerJoinEvent event){
            Player player = event.getPlayer();
            for (Player OnlinePlayer : Bukkit.getServer().getOnlinePlayers()){
                if (OnlinePlayer.equals(player) == false){
                    event.setJoinMessage(player + "has arrived at The Mansion");
                   
                }
                else
                  event.setJoinMessage("");
    help me pleasey :3

    figured it out, and its solved!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
    JWhy likes this.
Thread Status:
Not open for further replies.

Share This Page