(Tutorial) Teleport to Spawn Procedures (WIP)

Started by Spyjetray on

Topic category: User side tutorials

Last seen on 14:17, 4. Dec 2020
Joined Jul 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(Tutorial) Teleport to Spawn Procedures (WIP)
Sun, 06/09/2019 - 10:05 (edited)

While I've been working on my Infinity Gauntlet mod, I wanted the Space Stone to teleport the user to their spawnpoint but I could not find any tutorials on how to do this so I have created some quick teleport to spawn procedures to help with any other people who want to know how to make this.

1. Create some global_world variables called "SpawnX", "SpawnY" and "SpawnZ"

https://imgur.com/a/MdORQpH

2. Create a procedure that when the player sleeps in a bed, it sets the 3 variables to the player's current x,y,z position and then sets the spawn to the 3 variables.

https://imgur.com/a/UrR0y82

3. Create a procedure that when the player respawns, it calls the first procedure to ensure they appear at the spawnpoint.

https://imgur.com/a/2KL2slw

4. Finally, create a procedure that teleports the player to SpawnX,SpawnY,SpawnZ. Add this procedure to the item or block you wish to cause teleportation with.

https://imgur.com/a/bbehohj

 

I hope this helps, if you have any improvements you would like to share, I would love to see them as this is just a work in progress procedure until something better can be found.

Edited by Spyjetray on Sun, 06/09/2019 - 10:05
Last seen on 14:17, 4. Dec 2020
Joined Jul 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Glad you like it!
Sun, 06/09/2019 - 18:22

Glad you like it!

Nice tutorial ! And you can…
Wed, 06/12/2019 - 19:06

Nice tutorial ! And you can use the same procedure for make a /home command. (As I made for my mod Farm Adventure), but you have just to get x, y z (with global variables) when player execute /sethome (for example), and when player execute /home you teleport him to the coordonates.

Last seen on 16:51, 17. Apr 2024
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Does this sett the world…
Wed, 07/08/2020 - 18:00

Does this sett the world spawn for everyone???

Last seen on 14:53, 4. Jul 2023
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I really liked this just one…
Sat, 07/09/2022 - 14:51

I really liked this just one thing I did everything and when I went to the end it just tp me to some random place. Can you pls help with this and I followed the code directly.

Last seen on 14:53, 4. Jul 2023
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It works in the overworld…
Sat, 07/09/2022 - 14:51

It works in the overworld though

Last seen on 13:05, 26. Dec 2023
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there a way to reset this…
Tue, 11/21/2023 - 19:12

Is there a way to reset this once the bed is broken?