一个知道潜影盒是什么的 Minecraft 内置计算器。
无需退出游戏或掏出手机,即可快速计算技术玩家实际常用的数据:农场产出率、一堆物品相当于多少个潜影盒、填满某物需要多长时间。
仅服务器端。 玩家无需安装任何内容。服务器注册命令并向原版客户端发送命令树,由客户端自动补全。
/m 3456 items in sb -> 2 shulkers
/m 5sb / 2h -> 4320 items/hour (2.5 sb/hour)
/m (16*16*64) in st -> 256 stacks, what one chunk section is worth
/m 20st in sb -> 0.7407 shulkers
/m 1h + 30m -> 108000 ticks (1h 30m)
结果仅对提问者可见。在公共聊天中大声嚷嚷的计算器只会让人把它关掉。
安装
支持 Minecraft 1.21 至 26.3。从 GitHub Releases 或 Modrinth 下载对应 Minecraft 版本的 jar 文件,放入服务器的 mods/ 文件夹并重启。玩家不需要安装此模组。
Minecraft 26.3 需要 Java 25、Fabric Loader 0.19.5 或更高版本以及适用于 26.3 的 Fabric API。早期 1.21 版本使用 Java 21。更新时替换旧的 jar 文件,并保留 config/mankedomath.conf 以维持你的设置。
命令
| 命令 | 功能 |
|---|---|
/w4ve math <expression> |
标准拼写 |
/math <expression> |
短别名 |
/m <expression> |
更短,毕竟用 /math 来加两个数字很烦人 |
/math help |
上述示例,可点击 |
/math ans |
上一次的结果。也可在表达式中使用:/math ans / 64 |
/math share <expression> |
唯一会显示在公共聊天中的内容 |
/math reload |
重新读取配置文件(操作者等级 2) |
单位
这是让它成为 Minecraft 计算器而非普通计算器的部分。
| 后缀 | 代表 | 示例 |
|---|---|---|
st |
stack(堆),64 | 3st = 192 |
sb |
shulker box(潜影盒),27 堆 | 2sb = 3456 |
dc |
double chest(双层箱子),54 堆 | 1dc = 3456 |
t |
ticks(刻) | 600t = 30s |
s m h |
seconds(秒)、minutes(分)、hours(时) | 1h = 72000t |
b c r |
blocks(方块)、chunks(区块)、regions(区域) | 2c = 32 blocks |
也可以使用完整拼写(stacks、shulkerboxes、items、minutes、chunks),数字后有无空格均可接受。如果你的手指已经习惯了,sh 依然被接受为潜影盒的单位。
使用 in 进行转换:
/math 3456 items in sb
/math 100 blocks in c
/math 5sb in st
单位会贯穿算术运算,因此模组知道 5sb / 2h 是一个速率并会以每小时为单位打印,而 1sb + 1h 是一个没有答案的问题。
运算符:+ - * / % ^、括号,以及数字之间的单个 x 作为乘法。函数:sqrt min max abs floor ceil round log ln。
当你出错时
/m 1/0 -> dividing by zero is how you summon things. Cannot divide by zero
/m 1sb + 1h -> you cannot add cats and tuesdays. Cannot add time and items
/m 9^9^9 -> that number does not fit in minecraft. Exponent 387420489 is over the limit of 64
/m banana -> manke can do math but no reading minds. Unknown name 'banana'
玩笑从未替代原因,它只是引出了原因,并且 Brigadier 仍然会用下划线标出导致错误的确切字符。一个让你卡住的有趣错误,第二次出现时就不再好笑了。设置 funny_errors=false 可获得一个不带主观意见的计算器。
安全性
这里没有 eval,也没有脚本引擎。解析器是手写的,只读取一小段语法,不做其他事情,因为在公共服务器上放置解释器让用户加两个数,等于给路过的人敞开大门。
表达式长度、嵌套深度和操作次数都在执行任何乘法之前进行检查,指数上限在每个幂运算之前进行检查,因此 9^9^9 会弹出一条消息而不是消耗一个 tick。所有四个限制都在配置文件中。
配置文件
config/mankedomath.conf,纯文本 key=value 格式,带有注释。所有内容都可以通过 /math reload 重新加载,但命令名称是在服务器启动时构建到命令树中的,无法通过重载更改。文件中说明了哪些可以重载,哪些不能。
short_alias=true
aliases=math, m
funny_errors=true
max_length=256
max_depth=16
max_exponent=64
max_operations=500
decimals=4
click_to_copy=true
share_needs_permission=false
构建
./gradlew build
需要 JDK 21。jar 文件位于 build/libs/ 中。math 包是纯 Java,不包含任何 Minecraft 代码,并有自己的测试,这些测试会在每次推送时在 CI 中运行:
./gradlew test
许可证
MIT。属于 W4VE,Ware 4 Vanilla Experience。
A calculator inside Minecraft that knows what a shulker is.
Quick sums without leaving the game or reaching for your phone, aimed at what a technical player actually works out: farm rates, how many shulkers a pile of items is, how long something takes to fill.
Server-side only. Players install nothing. The server registers the command and ships the tree to a vanilla client, which autocompletes it on its own.
/m 3456 items in sb -> 2 shulkers
/m 5sb / 2h -> 4320 items/hour (2.5 sb/hour)
/m (16*16*64) in st -> 256 stacks, what one chunk section is worth
/m 20st in sb -> 0.7407 shulkers
/m 1h + 30m -> 108000 ticks (1h 30m)
Results are only visible to whoever asked. A calculator that shouts into public chat is a calculator people turn off.
Installation
Supports Minecraft 1.21 through 26.3. Download the jar for your Minecraft version from GitHub Releases or Modrinth, put it in the server's mods/ folder and restart. Players do not need the mod.
Minecraft 26.3 requires Java 25, Fabric Loader 0.19.5 or newer and Fabric API for 26.3. Earlier 1.21 versions use Java 21. Replace the old jar when updating and retain config/mankedomath.conf to keep your settings.
Commands
| Command | What it does |
|---|---|
/w4ve math <expression> |
The canonical spelling |
/math <expression> |
Short alias |
/m <expression> |
Shorter still, because typing /math to add two numbers gets old |
/math help |
The examples above, clickable |
/math ans |
Your last result. Works inside expressions too: /math ans / 64 |
/math share <expression> |
The one thing that does reach public chat |
/math reload |
Rereads the config (operator level 2) |
Units
This is the part that makes it a Minecraft calculator rather than a calculator.
| Suffix | Is | Example |
|---|---|---|
st |
stack, 64 | 3st = 192 |
sb |
shulker box, 27 stacks | 2sb = 3456 |
dc |
double chest, 54 stacks | 1dc = 3456 |
t |
ticks | 600t = 30s |
s m h |
seconds, minutes, hours | 1h = 72000t |
b c r |
blocks, chunks, regions | 2c = 32 blocks |
Longer spellings work too (stacks, shulkerboxes, items, minutes, chunks),
with or without a space after the number. sh is still accepted for a shulker
box if that is what your fingers already do.
Convert with in:
/math 3456 items in sb
/math 100 blocks in c
/math 5sb in st
Units carry through the arithmetic, so the mod knows that 5sb / 2h is a rate
and prints it per hour, and that 1sb + 1h is a question with no answer.
Operators: + - * / % ^, brackets, and a lone x between numbers as
multiplication. Functions: sqrt min max abs floor ceil round log ln.
When you get it wrong
/m 1/0 -> dividing by zero is how you summon things. Cannot divide by zero
/m 1sb + 1h -> you cannot add cats and tuesdays. Cannot add time and items
/m 9^9^9 -> that number does not fit in minecraft. Exponent 387420489 is over the limit of 64
/m banana -> manke can do math but no reading minds. Unknown name 'banana'
The joke never replaces the reason, it only introduces it, and Brigadier still
underlines the exact character that broke. A funny error that leaves you stuck
stops being funny the second time. Set funny_errors=false for a calculator
with no opinions.
Safety
There is no eval here, and no scripting engine. The parser is hand written
and reads one small grammar and nothing else, because putting an interpreter on
a public server so people can add two numbers is opening the door to whoever
walks by.
Expression length, nesting depth and operation count are all checked before a
single multiplication happens, and the exponent cap is checked before each power
is computed, so 9^9^9 bounces with a message instead of eating a tick. All four
limits are in the config.
Config
config/mankedomath.conf, plain key=value text, commented. Everything reloads
with /math reload except the command names, which are built into the command
tree at server start. The file says which is which.
short_alias=true
aliases=math, m
funny_errors=true
max_length=256
max_depth=16
max_exponent=64
max_operations=500
decimals=4
click_to_copy=true
share_needs_permission=false
Building
./gradlew build
Needs JDK 21. The jar lands in build/libs/. The math package is plain Java
with no Minecraft in it and has its own tests, which run in CI on every push:
./gradlew test
License
MIT. Part of W4VE, Ware 4 Vanilla Experience.
下载 MankeDoMath
下载 MankeDoMath
下载 MankeDoMath
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 MankeDoMath
下载 MankeDoMath
下载 MankeDoMath
下载 MankeDoMath
下载 MankeDoMath
下载 MankeDoMath
下载 MankeDoMath
为 1.21 到 26.2 的所有 Minecraft 版本构建,源自同一个代码库。
模组本身未作更改。整个移植过程仅涉及两次重命名:在 1.21.5 中,聊天点击和悬停事件变成了密封接口;在 1.21.9 中,GameProfile 变成了记录类。其余部分代码完全相同,因为该计算器不与 Minecraft 进行交互。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧