0

Is it possible to make a hot bar timer while only using minimal resources and command blocks? If so, how would you do it? My aim here is for a compact, and precise timer above your hot bar that you could use in a sort of mini game.

Note: this should be as efficient as possible and be displayed analog style, as well as having milliseconds(if possible and to not create lag), seconds and minute positions. This also utilizes the /title command.

  • 1
    Do you mean a timer using the experience bar? It’s definitely possible with the xp command, just mess around with levels and values until it looks right. – Sam Hill Jul 19 '20 at 3:59
1

Here is an extremely easy way to do it that looks natural: The XP Bar. Basically you use the /xp command:
/xp 120l @a
Then have a repeating command block and set the tick delay to 20. In that put the command /xp -1l @a That will now take one xp level from every player. Then if you want to test when it hits 0 you can either have a scoreboard system run alongside it OR have a block testing for /testfor @a[l=0] and when that is true the timer has reached 0.

0

Using consistent /title actionbar "Minute:Second" and some repeaters I think so. A human second is 20 in-game ticks.

  • 1
    Actually, a second is 20 game ticks, not 2. – ExpertCoder14 Jul 28 '20 at 0:54
  • @ExpertCoder14 Thanks for the clarification. As I said that was only an estimate so I'll edit the comment now. – Winfinity Jul 28 '20 at 0:57
  • 1
    Great, thanks. You might want to clarify that you need to run the command multiple times, one for each display, and clarify to replace Timer here with something. Right now, I had to think about it a little bit to understand these details. – ExpertCoder14 Jul 28 '20 at 1:22

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.