PlayerQuitEvent not working? - Still Not Working

Discussion in 'Plugin Development' started by olsyboy, Aug 10, 2015.

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

    olsyboy

    I have just added the PlayerQuitEvent, however it does not work.
    I have stuff that should happen when the player quits, but nothing happens.

    Here is the code:
    Code:
     @EventHandler
        public void onPlayerQuit(PlayerQuitEvent event) {
            Bukkit.broadcastMessage(String.valueOf(allPlayers));
            Bukkit.broadcastMessage(String.valueOf(playersPlaying));
            Bukkit.broadcastMessage(String.valueOf(playersPlayingGame2));
        }
    Here is my onEnable:
    Code:
    public void onEnable() {
            PluginManager pm = Bukkit.getServer().getPluginManager();
            pm.registerEvents(this, this);
            loadConfiguration();
            reloadConfig();
        }
    Thanks for any help
     
  2. Offline

    xXCapzXx

    Whole class?
     
  3. Offline

    olsyboy

    @xXCapzXx The entire main.java? Its pretty huge
     
  4. Offline

    SuperOriginal

    • Is the PlayerQuitEvent in your main class?
    • Are you sure your plugin is being exported/updated correctly?
     
  5. Offline

    olsyboy

  6. Offline

    SuperOriginal

    Any Exceptions in console? At all?
     
  7. Offline

    olsyboy

  8. Offline

    xXCapzXx

    Yes full class
     
  9. @olsyboy 1. Use saveDefaultConfig();
    2. Is the event in the main class?
    3. Tried debugging?
     
  10. Offline

    CoolDude53

    Make sure your Main class declaration implements Listener.

    Code:
    public class Main extends JavaPlugin implements Listener
     
Thread Status:
Not open for further replies.

Share This Page