Post a Reply
11638 views

Commmand Block Discussion

  1. 8 years ago

    Cool! I'm guessing you're using some sort of marker entity (armour stand?) to tp the player back to the death location. I'm guessing you know that Minecraft tries to unload all chunks every 45 seconds which will be your time limit at the moment, since you can't target entities in unloaded chunks.
    Thinking about this has also got me wondering how the warps on the server work, since you should be able to apply the same principle here (Boss Man?).
    For your needs you could permanently load the chunk (well not permanently but you know what I mean) but that doesn't seem viable for saving warp locations on a server because of how these could accumulate over time.

    I vaguely remember seeing a video a while back where someone tp'd an entity back and forth across the world border to somehow detect the coordinates of a player and store it as a scoreboard objective or something. I'll see if I can find it, although there's probably better ways of doing it.

    Oh and I know bugger all about command blocks so you probably ignore everything I just wrote.

    P.S. I spotted a typo

    @Tez1010 iff

    :P

  2. Just properly tried using commands for the first time!
    I found some interesting things you might find useful:

    Firstly the method in the video I showed is no longer possible because you don't seem to be able to teleport entities outside of the worldborder any more. I'm pretty sure you can still find coordinates using something similar to this by testing if a series of relative tp commands succeed/fail, since they will fail if they try to tp an entity outside the worldborder.

    Secondly you can tp a mob around unloaded and ungenerated chunks just fine. I only tested this by tping it out once and then back. There might be a limit on how many times you can tp it around unloaded chunks before the game can't find it any more. Strangely, I checked using MCedit and found that this doesn't load or generate the chunk (so no memory problems!).

    No idea if this is remotely useful or not, but I had fun playing with it!

  3. Thanks for your thoughts on this. I have done some further investigation.

    I now summon the marker entity by the command block in spawn. It seems if I then tp or teleport that entity to a specific place whether using relative coordinates or not it will stay available. If I tp it to the player that has died it doesn't stay available even though I summon it in spawn. Tp or teleport doesn't seem to make any difference to persistence if you use coordinates. This is true whether entered by command block or directly.

    -----------------------------------------------------------------------
    This is what I think you were suggesting and if I do it

    /execute @a[score_HasDied_min=1] ~ ~ ~ /teleport @e[name=Back,tag=AddID] ~ ~ ~

    it doesn't stay available, although it does take you to the right place. I have tried adding in an offset but that makes no difference.

    ---------------------------------------------
    if I do
    execute @a[score_HasDied_min=1] ~ ~ ~ tp @e[name=Back,tag=AddID] @a[score_HasDied_min=1]

    brings the marker out successfully but it doesn't stay available so I may as well not bother with the execute at the beginning.
    ------------------------------------------------------------
    and if I do

    execute @a[score_HasDied_min=1] ~ ~ ~ tp @e[name=Back,tag=AddID] x y z

    it would stay but I don't know x y z.
    -----------------------------------------------------

    Any further thoughts. My next idea is to just keep teleporting the marker to itself and see if that keeps it available, though I have run out of time to 'work' on it today.