Solved PlayerMoveEvent

Discussion in 'Plugin Development' started by Failplease, Jan 8, 2014.

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

    Failplease

    In Bukkit's PlayerMoveEvent, when getFrom() and getTo() are defined, it says nothing about getting the coordinates of the player before and after they move. I need to know how the code knows that "from" is the location of the player before they move and that "to" is their location after they move.
     
  2. Offline

    HyrulesLegend

    getFrom().getX/getY/getZ?
     
  3. Offline

    Failplease

    Max_The_Link_Fan
    No, I want to know how Bukkit determines that the location that is cast to "from" in the PlayerMoveEvent class is the location of the player before they move.
     
  4. Offline

    JRL1004

    Failplease I think that when the server receives a packet stating that the player has moved, the packet contains the exact location of the player (as stored by the client). This means that bukkit receive a packet saying "<Player> moved here." When this happens Bukkit most likely calls PME using the players location (according to the server) as getFrom() and the players new locations (as started by the packet) as getTo().
     
  5. Offline

    Failplease

    JRL1004
    Hmm okay... thanks again.
     
Thread Status:
Not open for further replies.

Share This Page