Player Move Event Listner code doesn't work when it should

XMLWordPrintable

    • Type: Bug
    • Resolution: Invalid
    • Priority: Major
    • None
    • Affects Version/s: None
    • Environment:

      Latest spigot build, windows 8.1, eclipse

    • My custom plugin

      I've got some code for an event handler for the PlayerMoveEvent that checks if a player has moved to the next block over only using getFrom and getTo but through my debug messages, I have found that it doesn't work. Here is my code:

      @EventHandler
      public void onPlayerMove(PlayerMoveEvent event) {
      // Check if he moved to another block
      if (event.getFrom().getBlock() != event.getTo().getBlock()) {
      event.getPlayer().sendMessage(ChatColor.BLUE + "debug: YOU MOVED!");

      I know it's not working because I get spammed when I move around inside the same block, or even look around for that matter because it also triggers the player move event

            Assignee:
            Thinkofname
            Reporter:
            Adam Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: