Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-526

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Major Major
    • None
    • None
    • 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

            Thinkofdeath Thinkofname
            Pocketkid2 Adam Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: