Mathematical calculation commands
by wifi-left
Mathematical calculation commands gives datapack makers and command users math functions that are awkward to write in vanilla commands, such as sums, min and max, averages, and trigonometry.
What it does
The mod provides math functions used in game that are hard to write with plain commands. Operations include addition, minimum, maximum, average, cosine, sine, tangent and square root, and the result can be written to a scoreboard value or printed in the chat bar. Scoreboards in Minecraft do not hold decimals, so results are rounded up before they are stored. A command can also return a random integer between a minimum and a maximum value.
The mod is aimed at datapack makers and at anyone building command chains on a world or server. It needs Fabric API, and it runs on Fabric or Quilt with either side able to load it, so a single-player world and a server both work without extra setup. Files exist for 1.19, 1.19.1 and 1.19.2, with 1.0.1 for 1.19.2 as the latest build. The code is open source under the CC0 1.0 Universal license, and public links to the source, issue tracker and wiki are listed.
Key features
Addition and rounding
Plus adds values together, and the result is rounded up so it fits an integer scoreboard.
Minimum, maximum and average
Min and max return the smaller or larger of two values, and average returns the middle value of a set.
Trigonometry and square root
Cosine, sine, tangent and square root can be computed inside a command chain.
Scoreboard storage
A result can be stored in a scoreboard value, with execute store result, or printed to the chat bar.
Random integers
A command returns a random integer between a minimum and a maximum value.
Language support
The mod ships with language support, including Simplified Chinese.
Compatibility
Latest build for each game version and loader.
Only full game releases are shown. This mod publishes no snapshot builds.
Requirements
Dependencies declared by the latest file for each loader.
Required 1
Use cases
Who it’s for: Datapack makers and server owners who write command chains that need arithmetic beyond what vanilla commands offer.
How it compares
MathMod is a Fabric mod for 1.21.4 that runs on the client alone and is released under the MIT License. Chat Math is another Fabric mod for 1.21.11, also client-side only and open source under the MIT License. Yet Another Calculator covers 1.20 – 1.21.7 on Fabric and Quilt, is client-side only and is open source under the Apache License 2.0. Mathematical calculation commands differs in that it runs on either side, and only up to 1.19.2.
| Mod | Loaders | Game versions | Environment | Updated |
|---|---|---|---|---|
| Mathematical calculation commands | Fabric and Quilt | 1.19 – 1.19.2 | Client or server, optional | 2022-08-23 |
| MathMod | Fabric | 1.21.4 | Client-side only | 2025-04-21 |
| Chat Math | Fabric | 1.21.11 | Client-side only | 2026-01-29 |
| Yet Another Calculator | Fabric and Quilt | 1.20 – 1.21.7 | Client-side only | 2025-07-08 |
Questions
Does Mathematical calculation commands need Fabric API?
Does the server need the mod?
Why are results rounded?
In the catalog
Mathematical calculation commands is one of 36,990 Utility mods on ModsFinder, and one of 25,772 Utility mods for Fabric. 12,559 mods support Minecraft 1.19.2.
More from wifi-left
Similar mods
What the author says
A mod that provides some math functions that can be used in-game more easily. (suitable for datapack makers) The output result will be output in the chat bar. If the value of the scoreboard has not been modified, you can store it with execute store result. If the value is modified this value will remain constant…
Official listing
- Modrinth page
- modrinth.com/mod/wifi-math-lib
- Owner
- wifi-left
- Published
- 2022-08-21
- Updated on Modrinth
- 2022-08-23
- Facts verified
- 2026-10-15