Command Block Question...

Discussion in 'General Minecraft Discussion' started by SUPERI0N, Mar 11, 2016.

  1. Hello everyone...
    I normally would prefer to figure such things out on my own.
    However I'm completely stumped on this and can't figure this out, so here I am. :)
    Please note that this will seem simple at first, however it is a little more complicated than it seems.

    I'm trying to continually teleport an entity to the player... Sounds simple right? Well although the following command will do it in a repeating command block,
    (/tp @e[type=Entity Here] @p)
    The problem is that the player can slightly outrun the Command Block...
    What I mean by this is the command block teleports the entity to the player so that it looks like it is following the player rather than it being right on top of the player at all times.

    This is most easily observed by putting the following command in a repeating command block,
    I will use an armorstand as an example.
    (/execute @p ~ ~ ~ /tp @e[type=ArmorStand,r=1] @p)
    Walk up to the armorstand for it to start getting teleported to you, Than fly away as fast as you can. The result is the armorstand is left behind while the desired result is that it's exactly on top of you the whole way...

    I am becoming fairly convinced that what I am asking for is impossible, however, I came here as a last hope... What I think is happening is the entity gets teleported to the player, but in the same tick the player also moves away from the entity which gives the "following effect". I could be wrong but I think that may be the case...

    I hope I explained this well, If I didn't however please let me know and I will try to do better...
    If it is possible and someone figured it out, I will give him/her credits for helping me figure this out...
    Thanks for reading everyone. :)

    Also staff, I don't make posts on the forums often so if this is in the wrong location I am sorry and feel free to move it to where it belongs. :(

    *edit* I forgot to add that what I am asking for is in 1.9 singleplayer...
    Birosquinha likes this.
  2. You can't use command blocks on emc... is this for sp or something?
    SUPERI0N likes this.
  3. You're right, all you can do is teleport the entity to the player continuously. Unfortunately in 1.8 the speed at which you can run the command is limited by the clock signal coming in, so you'll never get the entity exactly where the player is if they're running.
    On 1.9 though there are new types of command blocks that run without the need for redstone clocks, making it possible to run commands at high speeds. Check this video out for more info:
    SUPERI0N likes this.
  4. Sorry, I was tired last night and forgot to add that info...
    It's on singleplayer 1.9. :)
    Yea this is rather unfortunate... I mainly wanted this to be possible for a contraption I'm working on to look nicer, and although that isn't too big of a deal, It would be nice. KnightZer0ne however did come up with a method that might work. I'm not sure though as I havn't tested it yet...
    Yea I use those a lot. They are really useful and help my contraptions a lot, but they are sadly still not fast enough to fix the problem... :(

    Thanks for the help so far guys, I really appreciate your time... :D
  5. Your best bet (as far as I can come up with) is 1.9 where you get "continuous" command blocks but other than that I think you're out of luck. And even that only gets you so far: if the player moves out of range and the chunks get unloaded then you won't have anything ongoing at all.

    I think there will always be a delay between these two. But obviously this is only my 2 cents here.
    SUPERI0N likes this.
  6. You could use /execute to summon an armour stand above them with no gravity, then use /execute and /kill to get the player to kill it. Then it would appear to follow the player, but would be lots of different armour stands dying and spawning over and over.

    /execute @p ~ ~ ~ /summon ArmorStand ~ ~2 ~ {NoGravity:1b,CustomName:'x',CustomNameVisible:0b}
    /execute @p ~ ~ ~ /kill @e[type=ArmorStand,Name='x']
    SUPERI0N likes this.
  7. They're definitely the way to go, the 1.8 ones take up a lot more space. :)
    This is actually REALLY close to what I'm asking for, it still jumps a little bit but it is close to the point that I will consider using it. As for the dying over and over again, I don't think that it'll be too much of a problem as I haven't noticed any severe lag from it...

    Once again Thank You fellow Empire members, this info is really helpful... :)
    TotoStyle and ShelLuser like this.