Pair query with /execute store result score to put a live timer on the scoreboard, no repeating clock circuit needed.
Valid for Minecraft 26.2. Needs permission level 2 (gamemasters): run it as an operator, from the server console or from a command block.
/stopwatch runs named timers inside Minecraft. Create a stopwatch to start it, query it to read the elapsed time, restart it to set it back to zero and remove it when you are done. Each timer is identified by a simple id you choose, and the queried value can be captured with /execute store to drive scoreboards and map logic.
Minecraft added /stopwatch to Java Edition in 26.2. Before it existed, timing anything with commands meant building your own clock: a scoreboard objective, a repeating command block adding 1 to it every tick, and extra commands to reset or read it. /stopwatch replaces that whole circuit with four subcommands operating on timers the game tracks for you, each one identified by a resource location id such as race_timer or mymap:lap_1.
The command tree is deliberately small. create registers a stopwatch and starts it in one step; there is no separate start, stop or pause form in the syntax. query reads the elapsed time, restart zeroes a running stopwatch without deleting it, and remove gets rid of it entirely. Because stopwatches are named at the world level rather than attached to a player, every command and command block that knows the id reads the same timer.
/stopwatch requires permission level 2 (the gamemasters level): operators, the server console and command blocks can run it, and in singleplayer the world needs cheats enabled.
The full command tree is four branches. This is the complete syntax as defined by the game:
The id argument follows the standard resource location rules: lowercase letters, digits, underscores, hyphens and dots, with forward slashes allowed in the path and an optional namespace: prefix. A bare id like race_timer is read as minecraft:race_timer; maps that manage many timers usually namespace them, for example mymap:lap_1. The scale on query is a plain double and is the only optional argument anywhere in the tree.
Copy any of these straight into chat (as an operator) or into a command block:
/stopwatch create race_timerCreates a stopwatch named race_timer and starts it timing immediately.
/stopwatch query race_timerReports how long race_timer has been running and returns the raw value as the command's result.
/stopwatch query race_timer 0.05The same query scaled by 0.05, which converts a tick count into whole seconds.
/stopwatch restart race_timerZeroes race_timer without removing it, ready for the next lap or attempt.
/stopwatch remove mymap:race_timerDeletes a namespaced stopwatch. Ids without a namespace default to minecraft:.
query is built to be captured. Like every command, it returns a result value that /execute store can write into a score, and the optional scale lets you convert the value on the way out instead of doing scoreboard math afterwards. To show a race clock in seconds, set up an objective once:
/scoreboard objectives add race_time dummyThen run this from a repeating command block so the score tracks the stopwatch live:
/execute store result score @p race_time run stopwatch query race_timer 0.05Scores are whole numbers, which is exactly why the scale matters: 0.05 turns a tick count into seconds, 0.0008333 approximates minutes, and a scale of 1 (or no scale) keeps raw precision for tie-breaking speedrun finishes. Display the objective with /scoreboard objectives setdisplay sidebar race_time and you have a live race clock with no clock circuit at all. When the round ends, one /stopwatch restart arms the next attempt.
The /stopwatch command, added in Java Edition 26.2, manages named timers that run inside the game. It has four forms: create registers a stopwatch and starts it, query reads the elapsed time, restart sets it back to zero and remove deletes it. Each stopwatch is identified by an id you choose, such as race_timer.
Run /stopwatch create with an id of your choice, for example /stopwatch create race_timer. The stopwatch starts timing as soon as it is created; there is no separate start subcommand. Read it back at any point with /stopwatch query race_timer, and capture the value with /execute store result score to show it on a scoreboard or drive map logic.
Use /stopwatch restart followed by the id, for example /stopwatch restart race_timer. That sets the elapsed time back to zero while keeping the stopwatch going, which is what you want between race laps or parkour attempts. /stopwatch remove deletes the stopwatch entirely instead.
Scale multiplies the queried time before it is returned as the command's result value, the same way the scale argument works on /data get. Minecraft runs at 20 game ticks per second, so a scale of 0.05 converts the result to seconds. Leave the scale out to get the raw value.
Permission level 2, the gamemasters level. Operators, the server console and command blocks can run it; regular survival players cannot. In singleplayer you need cheats enabled for the world.
Stopwatch ids are resource locations: lowercase letters, digits, underscores, hyphens and dots, with forward slashes allowed in the path and an optional namespace prefix separated by a colon. race_timer, lap/1 and mymap:race_timer are all valid. An id without a namespace defaults to the minecraft: namespace.
Control the game clock itself, or browse more Minecraft tools: