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

PlayerMoveEvent does not get triggered while moving in a minecart

XMLWordPrintable

    • CraftBukkit version git-Spigot-f56e2e7-f17d591 (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT)
    • Stats
    • Yes

      When riding a minecart, the PlayerMoveEvent does not get triggered at all. I have tried both survival and creative gamemodes, just in case that would make a difference, but to no avail. 

      This is for a Statistics plugin. Looking to differentiate between different move types, see sample code below:

      @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
      protected void onPlayerMove(PlayerMoveEvent event) {
          if (event instanceof PlayerTeleportEvent) {
              return; // Breakpoint here
          }
          if (!event.getFrom().getWorld().equals(event.getTo().getWorld())) {
              return; // Breakpoint here
          }
          // Breakpoint here
          // Additional code here
      }
      

      As you can see, there are breakpoints for every case - if a PlayerMoveEvent is fired, a breakpoint will be triggered. For just walking around, the breakpoints do indeed trigger, so they work fine.

            Unassigned Unassigned
            lolmewn Sybren Gjaltema
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: