1

How to teleport an entity relative to another

That_PricklyPair's Avatar That_PricklyPair7/27/16 7:27 pm
1 emeralds 3.7k
I am currently doing a little game similar to Pac-Man inside of Minecraft and I needed to teleport an Armor Stand below me but stay with my every step. I looked and looked, but couldn't find a solution.
So I made one.

First, place a repeating command block and then three chain command blocks all pointing into one direction with the repeating one pointing at the first chain. Set the chain ones to "Always Active".
Then enter: "/effect @e[name=TARGET] 14 1 1 true" into the repeating command block.
Enter: "/tp @e[name=TARGET] @p" into the first chain command block.
Enter: "/tp @e[name=TARGET] ~X ~Y ~Z" into the second one and replace xyz with the correct coordinates away from your player that you want the entity to be.
Enter: "/effect @e[name=TARGET] clear" into the last chain command block.
Connect power onto the repeating command block.

Basically, the contraption makes TARGET invisible, teleports it to you, teleports to wherever you want TARGET to be, and makes it visible; all in a split second. No flashing or anything. Can be used with x, y, and z coordinates. Can also be used with all entities and does not necessarily have to involve a player.

Have fun!
Posted by That_PricklyPair's Avatar
That_PricklyPair
Level 1 : New Miner
1

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome