Jump to content

on world change help


Regonite

Recommended Posts

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. 🙂

Edited by CoolProgrammer

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.

1604908226_ScreenShot2021-01-28at10_32_28AM.png.2646ad6be239a9d0756a99e8e15602ab.png

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...