控制方块 用脚本编写的命令方块
命令方块很棒,它解锁了众多选项,让你能够制作出令人惊叹的作品,但有时对于大型项目来说,使用命令方块会变得过于复杂或冗长!这正是本模组发挥作用的地方,它允许你在游戏内 编写 脚本,并可以通过多种方式触发:
- 使用 红石 进行供电;
- 每个指定的 刻 自动运行一次;
- 每个指定的 刻 在通过 红石 供电时运行。
你仅用一个方块就能制作小游戏、工具以及更多功能!配合专为本模组设计的简易语言——拥有完整文档的 Control Script。
查看我们的 GitBook 文档,通过 此链接 详细了解 ControlScript。
该模组兼容哪些版本?
我正在努力将该模组适配到越来越多的版本和加载器中。
**模组加载器:** Forge
**Minecraft 版本:** 1.20.1 至 1.20.6
**平台:** Curseforge 与 Modrinth
如何获取?
Control Blocks(控制方块)类似于命令方块,只能通过指令获得。
/give @p controlblocks:control_block
查阅文档以获取完整信息!
如何支持本模组?
我目前不接受捐赠,但如果你愿意,可以分享本模组以帮助更多人了解它!此外,你也可以通过使用我的联盟链接创建 BisectHosting 服务器,或者加入我的 Discord 服务器 此处 来支持我。
文档
这不是完整的文档,请在 此链接 访问 GitBook 上的完整文档。
执行模式
| 模式 |
描述 |
| Pulse(脉冲) |
接收到红石脉冲时运行一次 |
| Repeat(重复) |
每隔 X 刻自行运行一次 |
| Redstone(红石) |
每隔 X 刻运行一次,但仅在通电状态下 |
ControlScript
ControlScript 是为本模组从零开始编写的一种小型脚本语言——没有外部库,也没有 Lua 运行时。它是一种简洁的语言,直接与 Minecraft 交互。
语言支持的功能
- 变量 (
var x = 10)
- 数学运算 (
+, -, *, /)
- 字符串拼接 (
..)
- 条件判断 (
if / elseif / else / end)
- 注释 (
-- 和 --[[ ]])
内置函数
| 函数 |
描述 |
log(message) |
向所有玩家的聊天栏发送消息 |
run(command) |
运行一个 Minecraft 指令(权限等级 4) |
randint(min, max) |
生成 min 到 max 之间的随机整数 |
round(number) |
四舍五入到最接近的整数 |
abs(number) |
取绝对值 |
outpower(level) |
设置方块的红色石粉输出信号强度 (0–15) |
outpower(level, ticks) |
让红色石粉输出信号持续 X 刻后降至 0 |
inpower() |
读取输入的红石信号强度 (0–15) |
快速示例
var player = "@p"
var roll = randint(1, 6)
log("你掷出了 " .. roll)
run(give player minecraft:diamond roll)
run() 函数支持任何模组的物品和指令——不仅限于原版。
查看更多内容,如自定义函数、get() 等,请 在此链接 查看我们的文档。
Made by Web Demon
Control Blocks Command Blocks You Script
Command blocks are great, and it unlocks so many options, and allows you to make incredible creations, but sometimes, for big projects it either gets much more complicated or too long! That is where this mod comes in, it allows you to code scripts in game that can be triggered in multiple ways such as:
- Power with redstone;
- Powers each said tick;
- Power each said tick on powered with redstone;
You can make minigames, tools, and way more with only one block! With an easy language made just for this mod, with full documentation called Control Script.
Check out our GitBook documentation to learn more in detail about ControlScript at this link.
What version is the mod compatible with?
I'm working to bring this mod to more and more versions/modloaders.
**Modloader:** Forge
**Minecraft Version:** 1.20.1 to 1.20.6
**Platforms:** Curseforge & Modrinth
How to get one?
Control Blocks are like Command Blocks, you can only get them via commands.
/give @p controlblocks:control_block
Check the documentation for full info!
How to support this mod?
I do not yet accept donations, tho, you can share this mod and help it getting known if you want! Also, you can support it by creating a BisectHosting server with my affiliate link or even join my Discord server here.
DOCUMENTATION
This is not the full documentation, check the GitBook for the complete docs at this link.
Execution Modes
| Mode |
Description |
| Pulse |
Runs once when it gets a redstone pulse |
| Repeat |
Runs every X ticks on its own |
| Redstone |
Runs every X ticks, but only while powered |
| |
|
ControlScript
ControlScript is a small scripting language written from scratch for this mod — no external libraries, no Lua runtime. Just a clean language that talks directly to Minecraft.
What the language supports
- Variables (
var x = 10)
- Math (
+, -, *, /)
- String concatenation (
..)
- Conditionals (
if / elseif / else / end)
- Comments (
-- and --[[ ]])
Built-in Functions
| Function |
Description |
log(message) |
Sends a message to all players in chat |
run(command) |
Runs a Minecraft command (op level 4) |
randint(min, max) |
Random integer between min and max |
round(number) |
Rounds to nearest integer |
abs(number) |
Absolute value |
outpower(level) |
Sets redstone output of the block (0–15) |
outpower(level, ticks) |
Pulses redstone output for X ticks then drops to 0 |
inpower() |
Reads the incoming redstone signal level (0–15) |
Quick Example
var player = "@p"
var roll = randint(1, 6)
log("You rolled a " .. roll)
run(give player minecraft:diamond roll)
run() works with any mod's items and commands — not just vanilla.
See more like Custom Function, get() and more in our documentation at this link.
Made by Web Demon
评论 0
登录后参与评分
还没有评论,来抢沙发吧