Concelled PlayerKickEvent still sends kick sends kick message to console

Discussion in 'Plugin Development' started by Gamecube762, Aug 31, 2013.

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

    Gamecube762

    So I was making making it so when an Admin or VIP is kicked for flying, it cancels the event and they don't get kicked. The code I created works, the problem is that it spamms the console ssaying that I was kicked for flying, anyone know how to remove that message or a way to monitor the messages sent to the console(will help with other ideas =P).
    Code:java
    1. @EventHandler
    2. public void PlayerKicked(PlayerKickEvent e) {
    3. Player p = e.getPlayer();
    4. String Reason = e.getReason();
    5.  
    6. if (Reason.equalsIgnoreCase("Flying is not enabled on this server")) {//flight section
    7. if (p.hasPermission("tmp.flight.nokick")) e.setCancelled(true);//warning, spamms console
    8.  
    9. }
    10.  
    11. }
     
  2. Offline

    chasechocolate

  3. Offline

    Gamecube762

Thread Status:
Not open for further replies.

Share This Page