Checking the player's last position. /back command

Discussion in 'Plugin Development' started by Vinnya124, Jan 1, 2015.

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

    Vinnya124

    Hi. I am a very new programmer to bukkit and java. I was wondering how you would create a /back command. Like how to check the player last position. Please help. I am sure this would be fairly simple, right? Thanks!
     
  2. Offline

    moo3oo3oo3

    I belive /back saves you location when ever you teleport. So when you teleport, get the player's location and save it
     
  3. Offline

    Cycryl

    @Vinnya124
    1) add in a HashMap<UUID,Location> to save player coordinates to.
    2) add a PlayerTeleportEvent
    do event.getFrom() and save it to the HashMap with the player's UUID
    3) when the player does /back
    check if there is an entry in the HashMap
    if there is teleport the player to that Location
     
    Sneling likes this.
Thread Status:
Not open for further replies.

Share This Page