Start a race stopwatch
/stopwatch create mypack:raceCreates the stopwatch mypack:race, which starts counting right away.

/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.
/stopwatch create <id>/stopwatch query <id> [<scale>]/stopwatch remove <id>/stopwatch restart <id>| Argument | Expects | What it does |
|---|---|---|
| id | Resource ID | Namespaced stopwatch ID, for example mypack:race. Each ID can exist only once. |
| scaleoptional | Number | Optional multiplier for the queried time in seconds, for example 100 for hundredths. |
/stopwatch create mypack:raceCreates the stopwatch mypack:race, which starts counting right away.
/stopwatch query mypack:raceShows how many seconds mypack:race has been running.
/execute store result score @s race_time run stopwatch query mypack:race 100Stores the elapsed time in hundredths of a second in your race_time score.
/execute if stopwatch mypack:race 30.. run say Time is upPosts the message once mypack:race has been running for 30 seconds or more.
Fill in the fields, then copy the command.
Command generatorstopwatch 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
In seconds, as the chat message shows. Add a scale such as 100 or 1000 to get a larger whole number for scores.
Use execute if stopwatch followed by the ID and a range, for example execute if stopwatch mypack:race 30.. for 30 seconds or more.
Type it in the chat with cheats on: /stopwatch create <id>.
Cheats on, or operator level 2.
It is in the official command tree since Java Edition 1.21.11.
/datapackCheats/reloadCheats/executeCheats/scoreboardCheats/functionCheats/scheduleCheats/returnCheats/randomEveryone