Solved [HELP] PlayerPreLoginEvent doesn't get called!

Discussion in 'Plugin Development' started by Steffion, Aug 20, 2012.

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

    Steffion

    Hello,
    I went crazy with this issue... Hope you can help me.
    I have this:
    Code:
    @EventHandler(priority = EventPriority.NORMAL)
        public void onPlayerPreLogin(final PlayerPreLoginEvent event) {
    Bukkit.broadcastMessage("§e1");
    }
    (just simple..)
    But i dont get "1" in chat... Please help?
    Other events does work in this class. (PlayerListener)
     
  2. Offline

    escortkeel

    hmm. I think you'll have to post more code than that. =/
     
  3. Offline

    Steffion

    escortkeel
    What do you want to see?
    The other events in the same class are working. So its not that?
    And the imports are right...
     
  4. Offline

    escortkeel

    Where the handler is registered? The method it is registered in?
     
  5. Offline

    Steffion

    escortkeel How do you mean? I have:
    Code:
            getServer().getPluginManager().registerEvents(playerListener, this);
    In the onEnable() method. But I dont understand what you mean?
     
  6. Offline

    Sagacious_Zed Bukkit Docs

    If you do not run a server in online mode, the pre login event does not fire. Make sure you have internet connectivity on your server.
     
    Steffion likes this.
  7. Offline

    Steffion

    Sagacious_Zed Really? Im testing the plugin on an offline mode server! Thats the problem! Thanks i will try!
     
  8. Offline

    Lolmewn

    In the new builds, there's an AsyncPlayerPreLoginEvent. Try that.
     
  9. Offline

    Sagacious_Zed Bukkit Docs

    Different event, fired on a different thread than the main game thread. Also does not fire unless you server is connected to the internet and on online mode.
     
  10. Offline

    Lolmewn

    I know. But who runs their server in offline-mode, right? ;)
     
  11. Offline

    Steffion

    Its fixed thanks all!
     
  12. Offline

    escortkeel

    Just for your FYI, you should not use the non-async event. Bad idea.
     
Thread Status:
Not open for further replies.

Share This Page