Minecraft Blogs / Tutorial

Delay commands without repeaters

  • 2,067 views, 1 today
  • 4
  • 2
Anakin002's Avatar Anakin002
Level 20 : Expert Procrastinator
13
Are you making a custom map and you need a compact way to delay commands without using kilometres and kilometres of repeaters? Then this tutorial is what you're looking for!



STEP 1

First of all, you need 3 commands blocks: the first must be a repeating one and the other two chain and they all have to be set on "always active". I also suggest you to place these commands in the spawn chunk in order to keep them active. Here's the order:


/tag @e[​tag=DelayCloud,nbt={Age:-1}] add DelayDone
v
/execute at @e[​tag=DelayDone] run data merge block ~ ~ ~ {auto:1b}
v
/execute at @e[​tag=DelayDone] run data merge block ~ ~ ~ {auto:0b}

(1.12.2 commands)




STEP 2

Once done this, you can finally proceed to delay the command!
Example: you want to make a dialogue and you need that two seconds passes between the messages. Something like this:

"Hello there!"
two seconds

"General Kenobi! You are a bold one!"

This time we need two type of command blocks: the pulse one and the chain one. The delayer command must be in the second type (this time they have to be set on "needs redstone"). Here's the order:


/tellraw @a {"text":"Hello there!"}
v
/summon area_effect_cloud CoordinatesOfTheNextCommandBlock {Tags:["DelayCloud"],Age:-40}
(replace -40 with the number you need, see below for more info)
v
/tellraw @a {"text":"General Kenobi! You are a bold one!"}

(If you're using a version older than 1.11, replace area_effect_cloud with AreaEffectCloud)


What the command does is basically creating an area effect cloud with the tag Age which is the equivalent of the time delay expressed in ticks (20 ticks = 1 second). Remember that the number must be negative.
I suggest you to set the commandBlockOutput gamerule to false to avoid the annoying command blocks output messages in chat.

If you want to delay only one command block, then you can do this:


Leave empty
v
/summon area_effect_cloud CoordinatesOfTheNextCommandBlock {Tags:["DelayCloud"],Age:-20}
v
/tp @p coordinates




CREDITS

I learned this trick thanks to this video by lorgon111 (now it is outdated since the commands shown in the video works for 1.12.2 and older) which was suggested to me by Macapple96 on an old forum which is now closed.
CreditLorgon111, Macapple96
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome