Solved PlayerBanEvent?

Discussion in 'Plugin Development' started by com. BOY, May 17, 2014.

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

    com. BOY

    There isn't a PlayerBanEvent in Bukkit. How to know when a player is banned?
     
  2. Offline

    TopTobster5

    com. BOY I believe you can use if (player.isBanned()) but you may need to check on that.
     
  3. Offline

    FabeGabeMC

    com. BOY You will need to check for a PlayerJoinEvent if the player is banned, like TopTobster5 said.
     
  4. Offline

    com. BOY

    I need to execute code when a player is being banned. That's why I needed an event. Sorry if that wasn't clear.

    EDIT: Oh hey, this will do:

    Code:java
    1. @EventHandler
    2. public void onPlayerQuit(PlayerQuitEvent event)
    3. {
    4. if (event.getPlayer().isBanned())
    5. {
    6. // Do stuff
    7. }
    8. }
     
    MineCrashKoen likes this.
  5. Offline

    MineCrashKoen

    Create a PlayerQuitEvent and in there, check if the player is banned. Because when a player is banned he automatically leaves :D
     
    com. BOY likes this.
  6. Offline

    com. BOY

    Beat my edit, haha
     
    MineCrashKoen likes this.
  7. Offline

    MineCrashKoen

    haha, I like your avatar XD
     
    com. BOY likes this.
Thread Status:
Not open for further replies.

Share This Page