How to check if a player is moving.

Discussion in 'Spigot Plugin Development' started by Jonnyo101, Feb 14, 2019.

Thread Status:
Not open for further replies.
  1. Hello is there a way to check if a player is moving ?

    I do not mean using the event i mean so call a isPlayerMoving() method on demand ?
     
  2. why dont u want to use the event
     
  3. Because i need to get if the player is moving from another class. And i need to get it at times when the method is called.
     
  4. if he moves you put him into a hashmap with a timestamp and check how long he hadnt moved
     
  5. Yer i did think of that but wanted to stay away from that because of the frequency of the event..
    Also with the event triggering on yaw and pitch movements.

    I should if stated i am only interested in xyz moving.

    If there not a more efficient way of doing that ?
     
  6. Thread solved.

    Just decided to write a class to update a hashmap every second by comparing last loc and current.
     
Thread Status:
Not open for further replies.