Disable join message?

Discussion in 'Spigot Plugin Development' started by avighnash, May 30, 2016.

  1. Whenever a player joins the server, it says in yellow "(player) has joined the game" and I want to get rid of that. How do I do that? I know its the default message, but I still do NOT like it.'

    Thanks!
     
  2. Upon joining
    e.setJoinMessage(null)
     
    • Agree Agree x 3
  3. This is in the PlayerJoinEvent.

    If you don't like the messages, you might also want to do this with the PlayerQuitEvent.
     
    • Agree Agree x 1
  4. Damn, you were faster than me.
     
    • Funny Funny x 1
  5. Untitled.png
    It still says "(player) joined the game"
     
  6. What are you trying?
     
  7. Or set the message to null no matter what, the if check is real bs
     
  8. I know, but he still gets the join message. Don't know if he still does.
    As I said I would normally do it with null instead of the if check.
     
  9. Wtf? I am trying to remove the yellow message at the top of the chat box 0_0
     
  10. You know what, nevermind. On my server it works with just e.setJoinMessage(null);
    What other plugins do you have? Some might interfere with your own plugin.
     
  11. He's asking for your current code, that you say isn't working.
     
    • Agree Agree x 1
  12. Code (Text):
    e.setJoinMessage(null);
    in my player join event.
     
  13. What other plugins do you have? Essentials?
     
  14. Did you register the event?
     
    • Agree Agree x 1
  15. Are you sure you've registered the event?
     
    #15 zThana, May 30, 2016
    Last edited: Jan 7, 2020
  16. Did you make the priority the highest? Did you register your listener? If both are yes, you need to post more code. That line in a player join event works for most people.

    As said above, you should tell us the plugin's you have, otherwise setting the priority to highest should override what other plugin's are doing.
     
  17. If you did not register the event then ofc. it does not work :p
     
  18. What if someone wanted to fix this without Essentials?
     
    #18 zThana, May 30, 2016
    Last edited: Jan 7, 2020
  19. As stated above, you can modify the default message provided by listening to #PlayerJoinEvent and #PlayerQuitEvent.

    Here are some things to consider:
    • Make sure no other plugin is taking priority to the events
    • Debug the actual event to see to what extent the code is being ran
    • Make sure the event is actually being fired (i.e You have registered your listener(s))
    • You could perhaps also try and input an empty string, (""), instead of null, though I'm sure it will return the same result
    Though this may be true, it would be a complete waste of space to have all the features implemented that essentials brings, to only utilize one of them.
     
  20. Ofcourse I registered the events... I am not that stoopid lol.
    It works when I set the priority to highest. Thanks!