Solved [HELP] PlayerPreLoginEvent doesn't get called!

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

  1. Offline

    Steffion

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    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

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    hmm. I think you'll have to post more code than that. =/
  3. Offline

    Steffion

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @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

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Where the handler is registered? The method it is registered in?
  5. Offline

    Steffion

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @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

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    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.

    This post has been edited 1 time. It was last edited by Sagacious_Zed Aug 20, 2012.
    Steffion likes this.
  7. Offline

    Steffion

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @Sagacious_Zed Really? Im testing the plugin on an offline mode server! Thats the problem! Thanks i will try!
  8. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    In the new builds, there's an AsyncPlayerPreLoginEvent. Try that.
  9. Offline

    Sagacious_Zed Bukkit Docs

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    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. Online

    Lolmewn BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I know. But who runs their server in offline-mode, right? ;)
  11. Offline

    Steffion

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Its fixed thanks all!
  12. Offline

    escortkeel

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Just for your FYI, you should not use the non-async event. Bad idea.

Share This Page