Minecraft:Commands/stopwatch: Difference between revisions
From SAS Gaming Wiki
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| Line 11: | Line 11: | ||
* When displayed, it is presented in seconds with 3 decimal places (e.g. <code>43.961s</code>). | * When displayed, it is presented in seconds with 3 decimal places (e.g. <code>43.961s</code>). | ||
* While any | * While any number can be used as the <code>scale</code> argument, a <code>scale</code> with a value >1000 is not useful to extract additional precision in the integer return value. | ||
== Syntax == | == Syntax == | ||
* '''''Java Edition''''' | * '''''Java Edition''''' | ||
: <code>stopwatch create <id></code> - Creates a stopwatch, which immediately begins running | : <code>stopwatch create <id></code> - Creates a stopwatch, which immediately begins running | ||
: <code>stopwatch query <id> <scale></code> - Gets the value of the stopwatch, the amount of time since it was created/restarted. <code>scale</code> does not affect the displayed value in chat, but does affect the value returned e.g. for {{cmd|execute store result...}}. If the return value would exceed 32-bit signed integer limits (<-2147483648 or >2147483647), it is clamped. | : <code>stopwatch query <id> [<scale>]</code> - Gets the value of the stopwatch, the amount of time since it was created/restarted. <code>scale</code> does not affect the displayed value in chat, but does affect the value returned e.g. for {{cmd|execute store result...}}. If the return value would exceed 32-bit signed integer limits (<-2147483648 or >2147483647), it is clamped. | ||
: <code>stopwatch restart <id></code> - Restarts a stopwatch | : <code>stopwatch restart <id></code> - Restarts a stopwatch | ||
: <code>stopwatch remove <id></code> - Removes a stopwatch | : <code>stopwatch remove <id></code> - Removes a stopwatch | ||
Latest revision as of 11:04, 26 July 2026
Template:Exclusive Template:Stub Template:Infobox command
Allows manipulation of stopwatches to keep track of real time — the time measured is not affected by the game's tick rate (i.e. pausing, Template:Cmd, or even server lag).
The time is calculated with millisecond precision. Therefore:
- When displayed, it is presented in seconds with 3 decimal places (e.g.
43.961s). - While any number can be used as the
scaleargument, ascalewith a value >1000 is not useful to extract additional precision in the integer return value.
Syntax
- Java Edition
stopwatch create <id>- Creates a stopwatch, which immediately begins runningstopwatch query <id> [<scale>]- Gets the value of the stopwatch, the amount of time since it was created/restarted.scaledoes not affect the displayed value in chat, but does affect the value returned e.g. for Template:Cmd. If the return value would exceed 32-bit signed integer limits (<-2147483648 or >2147483647), it is clamped.stopwatch restart <id>- Restarts a stopwatchstopwatch remove <id>- Removes a stopwatch
History
Minecraft:de:Befehl/stopwatch Minecraft:ja:コマンド/stopwatch Minecraft:pt:Comandos/stopwatch Minecraft:zh:命令/stopwatch