5

I am using invisible invulnerable ArmorStands to create "warps" and "homes" in a map. The idea is that I can spawn them in with a specific name, and then teleport a player back to them like this:

/tp @p @e[name=PlayerHome,type=ArmorStand]

These warps/homes need to be able to be moved, so I cannot just use static coordinates.

The ArmorStand method was working fine at first, however I have noticed that if the entity is not within spawn chunks or a radius of the player, I cannot teleport or interact with it in any way.

Is there any way I can teleport to a far-away entity? Or have it become loaded first?

I was thinking of doing something with /spreadplayers, which loads chunks that entities are spread to, but I cannot get it to target the unloaded ArmorStand.

  • Take a look at this video. It changes the spawn location in order to target an entity there, although this may not be appropriate for you. – MBraedley Sep 7 '14 at 18:07
  • @MBraedley A good lead, although, as there is only one worldspawnpoint, it can only work with a single warp. – SirBenet Sep 7 '14 at 19:41
  • I don't know much about command blocks, but it seems like if you needed to change the coords of a warp, you would have to run a command to change the location of the armor stands. Couldn't you instead run a command to change the command in another command block? I thought command modification was part of a recent update. – Johonn Sep 12 '14 at 16:07
  • @Johonn You can, but you can only change it to what is typed into the command that is changing the the other command block. I want to be able to move it dynamically, say, with a /trigger SetHome command. If you can find a way to get player coordinates into a command block though, that would work. – SirBenet Sep 12 '14 at 16:22
  • What exact functionality are you trying to implement? You say getting player coordinates would work. How would that solve your problem? I'm not sure I totally understand what you are trying to do. – Johonn Sep 13 '14 at 1:27
5
+200

You can spawn a redstone block a certain numbers above or below the point of the player with an activator rail ontop. Then spawn a command minecart on the activator rail with the command /spreadplayers ~ ~ 1 false @e[name=PlayerHome,type=ArmorStand,c=1,r=2].

Because the /spreadplayers will load the chunk the entity is spread to, the commandblock minecart on the activator rail will permenantly keep the chunk that the armorstand is in loaded. When moving the point, run a fill command and a kill command at the previous home to remove the traces. When you are teleporting the player back to their home, you can simply offset the teleportation by a few blocks in the y coordinate.

  • Nice solution! Unless there are any improvements onto this (such as not using a clock for each warp) this'll get the bounty. Also, spreading an armorstand/entity that isn't the player home armorstand means that I don't have to worry about offsetting the Y, and can have this device right at bedrock. – SirBenet Sep 16 '14 at 16:21
  • Wait.. Does it mean that /spreadplayers actually affect unloaded entities? I thought it only affects loaded entities. – aytimothy Sep 17 '14 at 0:51
  • No the way this works is because the player is there when the point is set, the chunk is loaded. this device doesn't load an unloaded chunk, it simply prevents the chunk from unloading. – ModDL Sep 17 '14 at 2:02
  • 1
    Btw this may not work after the world is reloaded – ModDL Aug 25 '15 at 0:04
-4

just run this command and replace the name with the entities name

/execute @e[name=name] ~ ~ ~ /tp @p @e[name=name]

  • Can you prove that this will work under the conditions set out by the asker? Additionally, it might not take the proper player, since it's executing from the entity position. – MBraedley Dec 22 '14 at 22:08

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.