Regonite Posted January 27, 2021 Share Posted January 27, 2021 How to get the player's location b4 they're world changes Link to comment Share on other sites More sharing options...
citeful Posted January 27, 2021 Share Posted January 27, 2021 When they try to change their world like through a command or teleporting, intercept the event. Get their coords and then execute the teleport to the new world. Link to comment Share on other sites More sharing options...
CoolProgrammer Posted January 28, 2021 Share Posted January 28, 2021 On 1/27/2021 at 6:23 AM, Regonite said: How to get the player's location b4 they're world changes on teleport: set {lastloc::%player's uuid%} to player's location command /back: trigger: teleport player to {lastloc::%player's uuid%} Little bit of explanation: The reason you can't use on world change event is, because that event doesn't allow you to get player's last location, or player's last world, and instead just get: event-player, event-world. But, on teleport event allows you to get these: event-block, event-world, event-player, event-teleportcause. Whenever a player teleports, it will store their immediate location in the variable {lastloc::%player's uuid%} and then teleport them. The on teleport event is also triggered when a player changes their world, so that way, you can store their previous location. Good luck. Hello there! If you're reading this, hope you're having a wonderful day! Feel free to contact me via Discord (CoolProgrammer#1920) for any help. My DMs are always open for help. You can also message via. forum messages for help. Also, don't hesitate to leave a like on my post if I helped you in any way. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now