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

player.getLocation() equals PlayerMoveEvent.getTo()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • None
    • Version 3785-Spigot-ddcbdcc-8c5311c (MC: 1.20) (Implementing API version 1.20-R0.1-SNAPSHOT)
    • Yes

      It seems like 1.20 has brought back this particular issue: https://hub.spigotmc.org/jira/browse/SPIGOT-1646
      Player.getLocation() is updated before the PlayerMoveEvent fires, thus, calling the former during an event will reflect the PlayerMoveEvent.getTo() location instead of the getFrom() one, like it did prior to the 1.20 update.
      This breaks all plugins that rely on the old logic (from=loc).

      The attachments below show the legacy behavior and the new one, for a comparison.
      For convenience, the plugin attached to the old issue was used.

        1. 1.19.4_log.log
          178 kB
        2. 1.20_log.log
          154 kB
        3. MoveLogger.java
          2 kB

            Unassigned Unassigned
            Lysandre Gan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: