Commmand Block Discussion

  1. ‹ Older
  2. 7 years ago
    Edited 7 years ago by NutjobBob

    That wasn't quite what I was suggesting. The key part I added was to have the marker entity teleported from spawn to a chunk that can never be loaded, at a coordinates relative to the players death.

    Teleporting entities and then targeting them seems to work as follows:
    Case 1. If origin is loaded and destination is loaded; entity can be targeted until destination unloads
    Case 2. If origin is loaded and destination is unloaded; entity can be targeted until origin unloads UNLESS destination becomes loaded before origin unloads. Then entity can be targeted until destination unloads.

    With the way you have it you're getting the first case whether or not you summon the marker in spawn, so you lose the entity eventually.

    What I did was to run
    /execute @a[score_HasDied_min=1] ~ ~ ~ /teleport @e[name=Back,tag=AddID] ~+210000 ~ ~
    on an entity in spawn

    Which forces the second case, and since the spawn chunks don't unload you can target it indefinitely. The value of 210,000 comes from the world boarder, which I set at 200,000. That way the chunk the marker is in can never be loaded by players, which would prevent you targeting it once that chunk unloads again.

    Then you can just do
    /execute @e[name=Back,tag=AddID] ~ ~ ~ /teleport @a[score_HasDied_min=1] ~-210000 ~ ~

  3. Edited 7 years ago by Retrochewy

    (/give @a minecraft:diamond_block 64) should do the trick! :D

  4. Edited 7 years ago by Tez1010

    That did the trick @NutjobBob! I added a clean up mechanism too by setting them a duration on the scoreboard and deleting when it gets to zero. As they were in unloaded chunks i had to do this.

    The scoreboard is how you differentiate them too. I assign players an id when they join. When the marker is created it is given the same id.

    So now i have a fully functioning and neat back command that works for more that one player, overwrites the previous death if you dont go back and allows you to go back for 5 minutes.

  5. @PlesleronTepryos
    NJB - "I don't think that you can. From what I can tell the best you can do test if a specific player is in a certain radius."

    In addition you could tp away anyone with the incorrect name.

  6. Edited 7 years ago by Tez1010

    @PlesleronTepryos

    lever at x y z redstone connected to:

    impulse /testfor @a[r=5,name=!Name] set radius as small as you can

    chain conditional /setblock x y z minecraft:air

    chain conditional /setblock xy z minecraft:lever d
    where d is the correct data for the lever in the off position

    will only work if only Name is there.

    for others it will reset the lever.

    you will get a slight pulse but there are ways round that

    Addendum to this - i tried it with just one fill block and taking the air out and this was not reliable. You need the air to make sure the pulse is over i think

  7. @Tez1010 Nice! Glad I could help. This behaviour seems kinda glitchy so I wouldn't count on working forever. I think it relates to this bug:

    https://bugs.mojang.com/browse/MC-108469

    Which causes this really weird bug:
    https://bugs.mojang.com/browse/MC-44514
    that seems to let you put a player in an unloaded chunk

or Sign Up to reply!