News
Game
Guides
Downloads
Versions
/stopwatch
COMMANDS COMMAND BLOCKS & MAPS CHEATS · LEVEL 2 Added in 1.21.11

/stopwatch command in Minecraft

/stopwatch creates named stopwatches that count elapsed time, then reads, restarts or removes them. It suits races, parkour courses and timed challenges in maps, and /execute if stopwatch can test the elapsed time directly, without a score.

Syntax

/stopwatch create <id>
/stopwatch query <id> [<scale>]
/stopwatch remove <id>
/stopwatch restart <id>
ArgumentExpectsWhat it does
idResource IDNamespaced stopwatch ID, for example mypack:race. Each ID can exist only once.
scaleoptionalNumberOptional multiplier for the queried time in seconds, for example 100 for hundredths.
All 5 forms
  • /stopwatch create <id>
  • /stopwatch query <id>
  • /stopwatch query <id> <scale>
  • /stopwatch remove <id>
  • /stopwatch restart <id>

Examples

Start a race stopwatch

/stopwatch create mypack:race

Creates the stopwatch mypack:race, which starts counting right away.

Java 26.3

Read the elapsed time

/stopwatch query mypack:race

Shows how many seconds mypack:race has been running.

Java 26.3

Save the time in a score

/execute store result score @s race_time run stopwatch query mypack:race 100

Stores the elapsed time in hundredths of a second in your race_time score.

Java 26.3

React after 30 seconds

/execute if stopwatch mypack:race 30.. run say Time is up

Posts the message once mypack:race has been running for 30 seconds or more.

Java 26.3
Build your command

Fill in the fields, then copy the command.

Command generator

Using stopwatches

stopwatch create mypack:race creates a stopwatch with a namespaced ID. query reads it and answers "Stopwatch 'mypack:race' has run for ...s", in seconds. The optional scale multiplies that value, so query mypack:race 100 gives hundredths of a second that you can store in a /scoreboard score with execute store result. restart starts it again from zero and remove deletes it.

In /execute, if stopwatch mypack:race 30.. passes once 30 seconds have gone by. Creating the same ID twice fails with "Stopwatch ... already exists", and an unknown ID gives "Stopwatch ... does not exist".

✓ Checked in Java Edition 26.3 · updated 2 November 2026

/stopwatch: FAQ

In which unit does /stopwatch query answer?

In seconds, as the chat message shows. Add a scale such as 100 or 1000 to get a larger whole number for scores.

How do I test a stopwatch without a score?

Use execute if stopwatch followed by the ID and a range, for example execute if stopwatch mypack:race 30.. for 30 seconds or more.

How do I use /stopwatch?

Type it in the chat with cheats on: /stopwatch create <id>.

Who can use /stopwatch?

Cheats on, or operator level 2.

Since when does /stopwatch exist?

It is in the official command tree since Java Edition 1.21.11.

Related commands