Solved 1.7.2 Method to ban players ?

Discussion in 'Plugin Development' started by Trevor1134, Mar 31, 2014.

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

    Trevor1134

    Hello, I have a plugin where it reads from a .yml file and if your in the file, you cannot join.. My issue is I can still join. I have this method for listening on join, what am I doing wrong?

    Code:
        @EventHandler
        public void onPlayerJoin(PlayerJoinEvent e) {
            Player p = e.getPlayer();
     
            if (cfg.getBannedConfig().contains(p.getName())) {
                p.kickPlayer("You are banned for: " + cfg.getBannedConfig().getString(p.getName()));
                return;
            }
    }
     
  2. Offline

    ferrybig

    use the playerlogin event for this instead
     
  3. Offline

    Trevor1134

  4. Offline

    masterofsixpack

    Send you main class in code in this thread :)
     
  5. Offline

    viper_monster

  6. Offline

    Trevor1134

    spoljo666 likes this.
  7. Offline

    xDGaming

    Make sure you have registered the event
    Edit: Should have refreshed before posing :p
     
Thread Status:
Not open for further replies.

Share This Page