Custom Ban Message Problem

Discussion in 'Plugin Development' started by exload, Oct 20, 2012.

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

    exload

    For some odd reason I am having trouble with this very simple issue. I'll give you my code then explain what is happening.
    Code:java
    1.  
    2. @EventHandler
    3. public void onPlayerLogin(PlayerLoginEvent event)
    4. {
    5. Player player = event.getPlayer();
    6.  
    7. for(String str : this.bans.getConfig().getStringList("bans"))
    8. {
    9. if(str.equalsIgnoreCase(player.getName()))
    10. {
    11. event.setKickMessage(ChatColor.RED+"You have reached the max warnings "+ChatColor.AQUA+">> "+ChatColor.YELLOW+"[url]http://mcacraft.com/ban-appeal/[/url] "+ChatColor.AQUA+"<<");
    12. event.setResult(Result.KICK_BANNED);
    13. }
    14. }
    15. }
    16.  

    There are no code errors and no console errors. I am basically trying to set the ban message to the string in event.setKickMessage, but I still get the default "The Ban Hammer has spoken!" instead. My best guess I am not setting this up properly..

    How should this be set up?
     
  2. Offline

    ZeusAllMighty11

    Do you have Essentials installed? (that has top priority I believe)
     
  3. Offline

    exload

    I was under the belief that essentials would give other plugins priority before itself, but yes, Essentials is on the server.
     
  4. Offline

    ZeusAllMighty11

    I think you can do event priority = HIGHEST or LOWEST
    Not sure if HIGHEST means last or if it means first
     
  5. Offline

    bob7

    Yup! Essentials will respond if you use
    event.disallow(PlayerLoginEvent.Result.KICK_BANNED, "asdasdasd");

    Which sort of pisses me off, but whateva :p


    I think if you use just KICK, and not Banned it'll work! hope i helped :3
     
  6. Offline

    exload

    LOWEST is first and I will try that as soon as I get a chance.
     
  7. Offline

    bob7

    Ehh, then it'll be incompatible with other plugins...
    I'm pretty sure you could just set Result.KICK_BANNED to Result.KICK
     
    calebbfmv likes this.
Thread Status:
Not open for further replies.

Share This Page