No Join Messages

Discussion in 'Spigot Plugin Development' started by PolyRocketMatt, Apr 14, 2017.

  1. Hello, I've a very simple question,

    How do I disable EVERY join message on a server!?

    I know that I must do this:
    Code (Text):
    @Eventhandler
    public void onJ(PlayerJoineEvent event) {
      event.setJoinMessage(""); //HERES THE THING
    }      
    But that doesn't cancel ALL the join messages from other plugins, right?
     
  2. Use this
    Code (Text):
    @Eventhandler(priority = EventPriority.HIGHEST)
    public void onJoin(PlayerJoinEvent e) {
      e.setJoinMessage(null);
    }      
     
    #2 42Jamie42, Apr 14, 2017
    Last edited: Apr 14, 2017
    • Funny Funny x 2
  3. yes,
    replace event.setJoinMessage(""); with
    event.setJoinMessage(null);
     
    • Agree Agree x 1
  4. Simple:
    Code (Text):
    event.setJoinMessage(null);
     
    • Agree Agree x 1
  5. You do the same if you want to remove death messages if you want, just set the message to null
     
  6. Helllo i say event.setJoinMessage(null); are this for message?
     
  7. Oh, that simple, alright, so this will cancel cancel all join messages, from every other plugin? Cool
     
  8. As long as they're not crappy plugins that just broadcast the message
     
  9. [​IMG]

    Why would you do this??
     
    • Funny Funny x 2
  10. --deleted, i am stupid--
     
    #10 42Jamie42, Apr 14, 2017
    Last edited: Apr 14, 2017
  11. Kicking a player when they just joined is pointless, and on top of that is causes them to see the world for a very brief moment which is just ugly. The login event even has dedicated methods for setting kick messages and such, so it is much easier on top of being cleaner. Also, you cannot cancel the PlayerJoinEvent.
     
  12. Sorry, everyone can make a typo :O
     
  13. Edited, im stupid