3

I tried:

/tp @e[type=ArmorStand,T=100] ~ ~1 ~

Then:

/tp @e[type=ArmorStand,Time=100] ~ ~1 ~

I'm stuck.

I am looking for a command-block only solution.

  • You can do something like a timer that starts from an output from a comparator or something like that. It depends on how long of a delay you need though. Actually, it kind of looks like you just want a slower clock, right? So I'd just use like a hopper clock rather than a repeat command – Unionhawk Jul 15 '16 at 2:02
  • no it has to be with command blocks – Smart_Snake Jul 15 '16 at 2:06
  • What minecraft version are you running? If you are running 1.9 or above I can help you. – GamrCorps Jul 15 '16 at 2:56
  • 1
    I posted a 1.9+ solution assuming you are using the latest version. – GamrCorps Jul 15 '16 at 3:19
4

So you are trying to do @e[T=100] and @e[Time=100], but T and Time are not selector arguments, so I will be showing you how to make a custom timer argument.


This solution only works on Minecraft 1.9 and above!

This is possible with scoreboard objectives. You will have to do the following for each command you want to delay. Note that this also only works on commands executed on entities.


How to make:

  1. Create a scoreboard objective to hold delays (I will use time as an example)

    /scoreboard objectives add time dummy
    
  2. Create a command block arrangement like this: Repeating > Chain > Conditional Chain

  3. Place the following commands into each command block:

    • Repeat Command Block:

      /scoreboard players add @e[score_time_min=1] time 1
      
    • Chain Command Block 1: Put your delayed command here. For example:

      /tp @e[type=ArmorStand,score_time_min={delay}] ~ ~1 ~
      
    • Chain Command Block 2:

      /scoreboard players set @e[score_time_min={delay}] time 0
      
  4. Start the delay by running this command:

    /scoreboard players set {entity} time 1
    

A few things to note:

  • Replace {delay} with the delay you want in ticks, plus one. For example, if you want a delay of 5 seconds, you would put 101 there since 5sec * 20 tick/sec + 1 = 101.
  • Replace {entity} with the selector for the entity that you want to run the command. For example, @e[type=ArmorStand,name=Bob].
  • The command in the second command block is up to you to. Just know that your need to run the command with {entity} targeted and you must have score_time_min={delay} in the entity selector for that command.

If you want a full example, here are the commands for the command blocks to teleport an ArmorStand by the name of "Bob" 5 blocks in the air 5 seconds after running the start delay command (step #4 above):

/scoreboard players add @e[score_time_min=1] time 1
/tp @e[type=ArmorStand,name=Bob,score_time_min=101] ~ ~1 ~
/scoreboard players set @e[score_time_min=101] time 0

Feel free to comment on this post with any questions! Ill try to answer them as soon as possible!

For additional information on how to format target selectors and arguments, see the Minecraft Wiki.

  • ah right, the whole "use a dummy command as a counter" trick. I forgot about that as a thing. – Unionhawk Jul 15 '16 at 12:11
  • @Smart_Snake you are very welcome. If this answer helped you to solve your problem, remember to hit the checkmark towards the top of the post to signify that a solution has been found for the question. – GamrCorps Jul 15 '16 at 22:18
  • hmm for some reason it will teleport if I put the command /scoreboard players set @e[type=ArmorStand] time 1 into the chat if I don't it won't work – Smart_Snake Jul 16 '16 at 0:30
  • That command is the command that triggers the delay. Therefore, running it is necessary. You can put it into a command block too. – GamrCorps Jul 16 '16 at 0:31
0

If you need too many repeaters to do your delay, just /fill the area of repeaters you need. If it takes too much space, just deal with it.

-2

Depending on whether you want a delay of seconds, or a delay of minutes, you can just use a string of repeaters.

  • Just command blocks it's not like I'm making a MAP! – Smart_Snake Jul 15 '16 at 2:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.