EventPriority?

Discussion in 'Plugin Development' started by jusjus112, Nov 28, 2014.

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

    jusjus112

    Hey, guys from the forum!

    I want to kick a player from the server if he is banned!
    But im getting the bukkit ban message!
    How do i override this message?

    i tried EventPriority Highest and high or low, but i dont know wich?

    Can you guys help me?

    This is the event:
    Code:java
    1. @EventHandler(priority = EventPriority.HIGHEST)
    2. public void onPlayerBan(PlayerLoginEvent e) {
    3. if (e.getPlayer().isBanned()) {
    4. e.getPlayer().kickPlayer(ChatColor.DARK_RED + "Banned: " + ChatColor.RED + " You are banned by an admin/operator");
    5. }
    6. }
     
  2. jusjus112
    Try PlayerPreLoginEvent. Check if the result is PlayerPreLoginEvent.Result.KICK_BANNED, then show them a custom message with PlayerPreLoginEvent.disallow with a KICK_OTHER result.
     
  3. Offline

    ROTN

    You want the LOWEST priority.
    Read the documentation here for a proper explanation.
     
Thread Status:
Not open for further replies.

Share This Page