Suppressing the join and quit messages

Discussion in 'Plugin Development' started by Spartan_V23, May 30, 2012.

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

    Spartan_V23

    As funny as it may sound, I cannot seem to figure out how to suppress the join and quit messages. I have an onPlayerJoin event and a onPlayerQuit event but I am not sure what code is needed to accomplish this. Any help is appreciated. :D
     
  2. Offline

    r0306

    Spartan_V23
    I think setting the join and quit messages to null may work.
    Code:
    event.setJoinMessage(null);
    Code:
    event.setQuitMessage(null);
     
  3. Offline

    DocRedstone

    You also could create a player listener and list for the join event. Then override it and set it to do nothing.
     
  4. Offline

    Spartan_V23

    Ill give this a try. Thanks.
     
  5. Offline

    Superkabii

    No no, you don't and couldn't override methods just because you implement listener. The events are fired and ultimately checked if you're cancelling them, but you can't just "override" the methods since it's not inherited in the first place and they're found reflexively. Rather these setJoinMessage and setQuitMessage methods would be called off the event objects already.
    Code:
    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {
        e.setJoinMessage(null);
    }
     
    DocRedstone likes this.
Thread Status:
Not open for further replies.

Share This Page