HeadBash Commands
(之所以这么命名,是因为为了让其中一些功能生效,我不得不把脑袋撞向电脑。)
HeadBash Commands 是一个小型模组,添加了一些简单的命令工具。除了 /save 和 /load 等基础命令外,该模组的主要功能是 /bash 命令,它允许你以类似于 /execute 的格式在命令中进行有限的脚本编写。每个命令的权限级别均可配置,且 /bash 命令原生不允许玩家像使用 /execute 那样绕过权限限制。
/bash
格式类似于 /execute,包含以下选项:
let <var> eq <value> - 将所有未来的 $<var> 替换为 <value>。仅支持数值类型。
let <var> eq (add|sub|mul|div|pow|log) <val_a> <val_b> - 与上述相同,但执行指定的计算并将结果赋值给 $<var>。
let <var> eq int <value> - 与上述相同,但将数字转换为整数。适用于 floor(向下取整)操作和美化打印。
for <var> in range <start> <stop> <step> - 为 for 循环中的每个步骤分叉命令,生成多个实例,并执行 let <var> eq <value>。不保证顺序,但通常保持一致。
(if|unless) <val_a> (eq|ne|gt|ge|lt|le) <val_b> - 仅当/除非指定的比较条件成立时,才继续执行命令。否则,该分支终止。
delay <duration> - 暂停当前分支的执行 <duration> 刻。
run <cmd> - 运行另一个命令。工作方式类似于 /execute 的 run 选项,但不支持自动补全,以允许延迟数值解析(等待前面的选项处理完毕后再解析命令),而不是让命令因出现类似“$i 不是 double 类型”的错误而失败。
/save
格式:/save <path> <pos1> <pos2> [noentities]
将指定区域保存为结构方块所生成的 <path>.nbt 文件。
/load
格式:/load <path> <pos>
在 <pos> 处加载指定的结构(来自 <path>.nbt)。
HeadBash Commands
(So named because I had to bash my head on my computer to get some of this stuff to work.)
HeadBash Commands is a small mod that adds a few simple command utilities. In addition to basic commands such as
/save and /load, the main feature of this mod is the /bash command, which allows you to do limited in-command scripting
in a format similar to /execute. The permission level of each command is configurable, and the /bash command
doesn't natively allow players to bypass permission restrictions like /execute would.
/bash
Formatted similar to /execute, with the following options:
let <var> eq <value> - Replace all future occurrences of $<var> with <value>. Only supports numeric types.
let <var> eq (add|sub|mul|div|pow|log) <val_a> <val_b> - Same as above, but performs the specified calculation
and assigns the result to $<var>.
let <var> eq int <value> - Same as above, but converts the number to an integer. Useful for floor operations
and pretty-print.
for <var> in range <start> <stop> <step> - Forks the command into multiple instances with let <var> eq <value>
for each step in the for-loop. Ordering is not guaranteed, but is generally consistent.
(if|unless) <val_a> (eq|ne|gt|ge|lt|le) <val_b> - The command is continued only if/unless the specified
comparison condition is true. Otherwise, the branch stops.
delay <duration> - Suspends execution of the current branch for <duration> ticks.
run <cmd> - Runs another command. Works similarly to /execute's run option, but doesn't support autocomplete
to allow for lazy numeric parsing (waiting for previous options to be processed before parsing the command),
rather than having the command fail with errors like "$i is not a double".
/save
Format: /save <path> <pos1> <pos2> [noentities]
Saves the area as a structure block would to <path>.nbt.
/load
Format: /load <path> <pos>
Loads the specified structure (from <path>.nbt) at <pos>.
评论 0
登录后参与评分
还没有评论,来抢沙发吧