PlayerListener changed?

Discussion in 'Plugin Development' started by Xstasy, Jan 23, 2011.

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

    Xstasy

    My playerlistener does not send onPlayerJoin, onPlayerQuit or onPlayerChat anymore.

    My imports in TestPlayerListener:
    Code:
    import org.bukkit.*;
    import org.bukkit.entity.Player;
    import org.bukkit.event.player.*;
    import org.bukkit.event.player.PlayerLoginEvent.Result;
    My public void:
    Code:
          public void onPlayerChat(PlayerChatEvent event) {
              Player player = event.getPlayer();
              String message = event.getMessage();
              System.out.println("Chat message supposedly sent.");
          }
    Was there done any changes to the PlayerListener?
    I cant seem to find the error. onPlayerCommand works just fine.
     
  2. Offline

    Archelaus

    Post your [PluginName].java file.
     
  3. Offline

    Xstasy

    Fixed it. My stupidity, forgot to add the events.
    Second note, I added event.setCancelled(true) to my onPlayerChat, but it still outputs the text in chat.
     
  4. Offline

    Archelaus

    The event needs to check if it's been cancelled

    Code:
    if(event.isCancelled()) {
    //stuff
    }
     
Thread Status:
Not open for further replies.

Share This Page