0

Essentially, I am trying to make a /sethome function in command blocks. I want to use a 'Command Book' where the command block tests if I have written /sethome, and then it /spawnpoints me to my current location. Then, if I write /home, I want it to be able to teleport me to my /spawnpoint without killing me. I really don't know how to do this or if it is even possible, any advice?

  • Does it usually kill you when you do /spawnpoint? I thought it just teleported you. – Fezodge Oct 25 '15 at 20:04
  • No, /spawnpoint sets your spawn. However, as far as I am aware, you need to die to be sent to that point automatically. – goldenlord52 Oct 25 '15 at 20:09
  • Oh right, yeah. Can't you do something like /tp spawn or /spawn? (It's been a while since I last played...) – Fezodge Oct 25 '15 at 20:10
  • 1
    I don't think so. As far as I am aware, /spawn is a multiplayer command. – goldenlord52 Oct 25 '15 at 20:12
  • Oh right, well then sorry I can't help you. – Fezodge Oct 25 '15 at 20:13
0

If you want to do this you could test for when the person writes /sethome and then summon an invisible marker armor stand in that spot. Once they type /home then you can teleport them to it.

e.g.

/execute @a[score_wrotesethome_min=1] ~ ~ ~ summon ArmorStand ~ ~ ~ {Invisible:1,Invulnerable:1,Marker:1,CustomName:"Home",NoGravity:1}

/execute @a[score_wrotesethome_min=1] ~ ~ ~ spawnpoint @p ~ ~ ~

This will set their spawnpoint to where they are when they write it and summon an invisible Armor Stand named "Home"

Then you can teleport any player who writes /home to that armor stand.

See this video by Dragnoz to find out how to teleport a player to an entity.

Hope this Helps!

  • Thanks! This really helped :) I was looking for a sethome function so this is exactly what I needed. – goldenlord52 Nov 15 '15 at 16:32
1

If you go through an end portal whilst in the end, you are returned to your spawn point.

Prerequisites:

  1. Set an end_portal block at a specific coordinate in every dimension (E.G: 350000, 0, 350000).
  2. Set up an objective to track whether players are in the end already: /scoreboard objectives add isInEnd dummy

Then, whenever you want to teleport a player:

  1. /scoreboard players set @a isInEnd 0
  2. /scoreboard players set @a isInEnd 1 {Dimension:1}
  3. /tp @a[score_isInEnd=0] 350000 0 350000
  4. /tp @a 350000 0 350000
  • I have to mention that the returning point does not need to be set by command nor book, just sleeping in bed at that place is enough (and leaving the bed there) – Antoine Hejlík Oct 26 '15 at 9:44
-1

You can just type in this simple command:

/spawnpoint [your_name_here] x y z

.x, y and z are coordinates. Then enter, you'll have a new spawnpoint at x y z!

  • While true, the question very clearly asks about something else. – MrLemon Oct 26 '15 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.