3

I want to make a clock with a precision of one second.

So,there are two ways to do this.

  1. A redstone clock (one second) and a command block running /scoreboard players add @e[name=Time] Time 1.
  2. 3 command blocks and two scoreboards.
/scoreboard players add @e[name=Time] Tick 1.
/scoreboard players set @e[name=Time,score_Tick_min=20] Tick 0
/scoreboard players add @e[name=Time,score_Tick=20,score_Tick_min=20] Time 1

Which one consumes less performance? And why?

1
  • You're talking about Java edition, right? Commented Feb 1, 2019 at 8:35

1 Answer 1

4

In general, redstone is evil for performance. Especially depowering redstone dust causes a lot of lag. Pure command blocks are almost always better, but even better are functions. They are especially optimised and they don't require the slightly lag causing tile entities of command blocks.

And even that can be further optimised in 1.14, using /schedule (archive). Just add this at the end of your function:

schedule function <function> 20

Alternatively, you can write "1 second" directly:

schedule function <function> 1s

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .