{SOLVED}[Overiding Bukkit] Remove join message

Discussion in 'Plugin Development' started by Matthewenderle, Jul 1, 2012.

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

    Matthewenderle

    Hello. Is it possible to remove the Message as indicated in the snapshot below with the letter "R"?
    [​IMG]
    I want to keep the "+ Player AugmentedVirus has joined the game!" and I know that the second line is from essential's geoip and admins only. I just need to remove the yellow text.

    My code as of now.
    Code:
    @EventHandler(priority=EventPriority.MONITOR)
        public void onPlayerLogin(PlayerLoginEvent event)
        {
            String player = event.getPlayer().getDisplayName();
            Bukkit.broadcastMessage(ChatColor.GREEN + "+ " + "Player " + player + " " + "has joined the game!");
            //PnCrux.info(ChatColor.GREEN + "+ " + player + " " + Config.MessageJoin);
        }
       
        @EventHandler(priority=EventPriority.MONITOR)
          public void onPlayerQuit(PlayerQuitEvent event)
        {
            String player = event.getPlayer().getDisplayName();
            Bukkit.broadcastMessage(ChatColor.RED + "- " + "Player " + player + " " + "has left the game!");
            //PnCrux.info(ChatColor.RED + "- " + player + " " + Config.MessageLeft);
        }
    You may notice that there are a couple of these
    Code:
    + " " + "has...
    and that is because I was using a config before but I temporarily made it static.
    My guess to do this would to "@Override" something, but I have essentials and I still want it to run it's checks for isBanned, Muted, etc.
     
  2. Offline

    Sushi

    event.setQuitMessage("");
    event.setJoinMessage("");
     
    Matthewenderle likes this.
  3. Offline

    Deathmarine Retired Staff

    That will set a blank line.
    event.setJoinMessage(null);

    :)
     
    Matthewenderle likes this.
  4. Offline

    Matthewenderle

    Thanks so much. I did have to change my Login method to join...
    Code:
        public void onPlayerJoin(PlayerJoinEvent event)
     
  5. Offline

    oasis9

    The event.setJoinMessage(null); and event.setQuitMessage(null); still leave a blank line. (BTW, I'm using the setQuitMessage in PlayerQuitEvent, not join)
     
  6. Offline

    BungeeTheCookie

    Jesus Christ, 1,808 views?
    EDIT: oasis9
    Dude, you just bumped this forward a year, and it has already been solved. Make a new thread if you have a problem, don't just bump a thread that has 1,080 views up a year, that scared the crap out of me. ._.
     
Thread Status:
Not open for further replies.

Share This Page