Save && check for coordinate difference?!?!?!?!?!

Discussion in 'Plugin Development' started by B3N909, Jun 24, 2014.

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

    B3N909

    Hello I am trying to use the PlayerMoveEvent to check if the player is moving in the same block or is actually moving block to block. Currently I have it where it is finding the players x, y, z then rounding them. But how would I check for the next move cord and save the last one?
     
  2. Offline

    thecrystalflame

    Bukkit locations contain a method named distance() this compares the two locations and returns the distance in blocks between the two. if you have the values floored before compoaring if a player moves from 1 block to another it will return a value of 1.
     
  3. Offline

    B3N909

    thecrystalflame Yes, but my question is how do I save the new position AND do the new position? This is just leaving me speechless.. Do you think you could come up with some code because I have no idea how to save the old location and then the new one but the when they move save the new one to the old one???!?!?!??!
     
  4. Offline

    fireblast709

    B3N909 Do you even Javadocs? Also this is not the place where spoonfeeding is preferred. Either be ready to learn or ready to move to plugin requests :p
     
  5. Offline

    B3N909

    fireblast709 no need to be rude about it. I hope there is not more people like you to bring the community down. I don't want all the code but just need a example on how to do it. I find that I personally learn better from it this way. And to answer your question I do read the Bukkit API. - thanks again!
     
  6. Offline

    fireblast709

    B3N909 In fact you will find that I do have my share of answering threads. If you have read the Javadocs, you would've seen this page explaining the methods PlayerMoveEvent has, including getFrom() and getTo(), the old and new Location respectively.
     
  7. Offline

    B3N909

Thread Status:
Not open for further replies.

Share This Page