Cancel VERY specific event

Discussion in 'Plugin Development' started by TehChikenHater, Sep 20, 2013.

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

    TehChikenHater

    Hello,

    I'm working on a simple kick/ban/banip plugin and I'd like to cancel a login event, so it does not broadcast "Player <playername> joined the server!" How would I do this?

    EDIT: I want to completely cancel the login event. Meaning the server console doesn't even display the login attempt. If the console log is not possible, the chat is fine. Thank you.
     
  2. Offline

    Gater12

    TehChikenHater So, when a player logins does the player not connect and get kicked or does it connect but doesn't say "Meh joined the game" or something?
     
  3. Offline

    TehChikenHater

    Gater12 The player does not connect and gets kicked.
     
  4. Offline

    Shzylo

    Use a PlayerPreLoginEvent
     
  5. Offline

    TehChikenHater

    Gater12 Would you also happen to know how I can search a Yaml file for a specific value, not knowing it's "path". Let's say I have in my Yaml file

    Code:
    blah: abc
      one: def
      two: ghi
    So let's say I want to search for whatever "parent" (blah) has a "child (one/two) with the value of "def". And then get the "path". So something like this....

    Code:java
    1. public void FindValue(String blah) {
    2. //blah blah blah
    3. String path = whatever_the_path_is_to_the_value_blah.one
    4. return path;
    5. }


    Shzylo According to the JavaDocs (Via Eclipse), PlayerPreLoginEvent is decapitated and should not be used. Any other suggestions, or should I go ahead and ignore the suggestion from Eclipse?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  6. Offline

    The_Doctor_123

    TehChikenHater
    Not all deprecated things are a bad idea to use. For example, player.updateInventory().
     
  7. Offline

    TehChikenHater

  8. Offline

    The_Doctor_123

    TehChikenHater
    I take that back. PlayerPreLoginEvent is deprecated due to running on the main thread. Use AsyncPlayerPreLoginEvent to prevent some lag.
     
    Shzylo likes this.
Thread Status:
Not open for further replies.

Share This Page