Getting a players last location

Discussion in 'Plugin Development' started by Minermax7, Apr 13, 2014.

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

    Minermax7

    Hey guys,
    I ran into some trouble making a /back command like in essentials. All I want it to do is like log the players last location, due to death, tp, etc. I looked in the essentials code and it has lots of user.getLastLocation(). I was wondering if anyone had a solution to this.. Also my variable for player is player.. Pretty simple, I'm not sure if I need to create a ondeath event or on teleport event for the player and then log the information or something. Any help is greatly appreciated! :)
    Kind regards,
    Dylan.
     
  2. Offline

    Konkz

    Make a HashMap with players name and location, when PlayerDeathEvent is triggered save location to hashmap <konkz, *Location here*> and when /back is used just retrieve the location that is appropriate to the name.

    You can then also do /back konkz which would send you to last saved location of konkz.

    Minermax7
     
    Minermax7 likes this.
Thread Status:
Not open for further replies.

Share This Page