Using spreadplayers to tp them to armorstand in unloaded chunk

Using spreadplayers to tp them to armorstand in unloaded chunk - Free stock photo of at home, beautiful, beautiful black women

I'm making a new public server. Right now, I have a book with set home / go home / tp to Spawn functionality. The set home uses a trigger that places an invisible armor stand named Home (and deletes the old one if one exists already) where the player is. The go home uses a trigger that teleports the player to the armorstand. The problem is is that if the chuck isn't loaded anymore, teleporting to the Home armor stand doesn't work either. Being a public server, using custom tp co-ordinates with each player's home in a command block from spawn isn't feasible, and from what I've seen about chunk loaders they're pretty big and hard to replicate.

I've been doing some looking around, and there seems to be a way to use the spreadplayers command to get someone to an entity with that name, but I can't find the exact commands to get it to work.

I also came across this article How can I teleport to an unloaded entity? and I basically went to 1000x1000 coordinates, and used the following commands to set a redstone block with an activated rail on top with a command block minecart on top of that using the suggested command:

/fill ~-1 250 ~-1 ~1 253 ~1 minecraft:bedrock 0 hollow

/fill ~ 251 ~ ~ 251 ~ redstone_block 0 replace

/fill ~ 252 ~ ~ 252 ~ activator_rail 0 replace

/summon MinecartCommandBlock ~ 252 ~ {Command:"/spreadplayers ~ ~ 1 false @e[name=Home,type=ArmorStand,c=1,r=2]"}

Then I used the sethome trigger to place the armor stand on the ground directly below the setup in the sky. The idea behind it was that when a player sets home, it's supposed to keep that chunk loaded (supposedly) so that the player can tp to the entity from a distance away. After testing, that still isn't working if I use the trigger to tp to the home entity.

I feel like I'm missing something or going about things in the wrong way. If the spread players command loads the chunk before teleporting a player there, is there a way to use the armorstand as a target with a range of 1 or something, or is there some way that I should be activating that command block minecart above the armorstand, or is there maybe another way to keep the chunk active?



Best Answer

You can always just use this command if your server is in 1.14:

/forceload add <1stchunk> <2ndchunk>

Just as if you were using /fill, put the XZ of the first chunk location in the <1stchunk>, and put the XZ of the second chunk in the <2ndchunk>. This will cause the specified chunks to always be loaded. Just be warned that this wont work if your server involves laggy things such as redstone, as if redstone is loaded in the lot, it will get very laggy.




Pictures about "Using spreadplayers to tp them to armorstand in unloaded chunk"

Using spreadplayers to tp them to armorstand in unloaded chunk - Man in Blue Shirt Sitting Beside Woman in Black and Red Floral Shirt Using Macbook
Using spreadplayers to tp them to armorstand in unloaded chunk - Man in Blue and Black Striped Long Sleeve Shirt Sitting on Chair
Using spreadplayers to tp them to armorstand in unloaded chunk - Woman in Red Tank Top Sitting on Gray Couch



Can you teleport to chunk in Minecraft?

Although most commands can affect only chunks that have already been generated, /teleport can send entities into chunks that have yet to be generated. If this happens to a player, then the chunks around and including that player's destination are newly generated.

How do you spread entities in Minecraft?

/Tp <targets> <destination> This command will teleport a target block to a different destination. If a player wishes to move a target, but the moving distance is too far away, the player can use this command to teleport it to the set of coordinates that they wish to move it to.



Why Sudo Is The Best Command in Minecraft




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Yan Krukov, RODNAE Productions, RODNAE Productions, Kindel Media