Topic category: User side tutorials
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"
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.
3. Create a procedure that when the player respawns, it calls the first procedure to ensure they appear at the spawnpoint.
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.
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.