LunaLace's Gomoku
This mod adds a Gomoku board block to Minecraft, supporting AI matches, multiplayer matches, and spectating.
Gomoku Board Block
-
Craft the Gomoku board using string and any type of planks. Place string in the center slot of the first row and planks in the center slot of the second row, leaving all other slots empty.
-
Unlock the recipe in the recipe book by picking up the crafting ingredients while holding both string and any type of planks.
-
In Survival Mode, breaking the Gomoku board block drops the block itself.
Match Flow
Right-click the Gomoku board block to open the main menu, where you can choose to start a match with no forbidden moves, start a match with forbidden moves, join a room, or spectate a match.
-
Forbidden Move Settings: You can enable any combination of the following forbidden moves: overlines, double-fours, and double-threes. Confirm your selection to proceed to the mode selection screen.
-
Mode Selection: Choose between AI and multiplayer matches.
-
AI Matches: Choose to play as Black or White. If the external Rapfi engine is configured, you can also select the engine to use: the built-in AI or Rapfi.
-
Multiplayer Matches: The host creates a room and waits for another player to join. Once a player joins, the host chooses the side assignment: host plays as Black, host plays as White, or sides are assigned randomly.
All screens have a back button in the upper-right corner to return to the previous screen.
Game Rules
-
The board is 15×15. Black moves first. A player wins by placing five consecutive stones horizontally, vertically, or diagonally.
-
White has no forbidden moves. Five or more consecutive stones count as a win.
-
When the corresponding forbidden-move rules are enabled, Black immediately loses if a move violates any enabled rule. If the overline rule is disabled, an overline by Black counts as a win.
-
Undo: In AI matches, undo takes effect immediately and retracts the last two moves—one from the player and one from the AI. In multiplayer matches, an undo request must be approved by the opponent before it takes effect.
-
After a match ends, you can choose to start a new match or exit using the back button.
-
Win Statistics: The upper-left corner of the interface displays each player's win count for that board block. Statistics are saved with the world.
-
Spectating: Other players can spectate matches in real time. The lower-left corner displays the spectator count; click it to expand the spectator list.
-
Match outcomes are determined by the server, while the client handles display only. All move requests are validated by the server.
AI Engines
-
Built-in AI: Included with the mod and requires no additional configuration.
-
Rapfi Engine: The mod can launch the open-source Rapfi Gomoku engine through the Piskvork protocol. To use it:
-
Obtain the Windows executable (
pbrain-rapfi) or compile it from source. -
Place the executable at any location and specify its full path in the configuration file.
-
The
ai.thinkTimeMssetting controls Rapfi's thinking time per move in milliseconds. The default is1000, and the valid range is100to60000. Restart the game for changes to take effect.
-
-
If Rapfi is not configured or fails to launch, the mod automatically falls back to the built-in AI.
Configuration
The configuration file is located at config/lunalacegomoku-common.toml. If you use a launcher with separate directories for different game versions, the file is located in the config folder of the corresponding version directory.
| Configuration Option | Description | Default |
|---|---|---|
ai.rapfiPath |
Path to the Rapfi executable. Leave empty to use the built-in AI. | Empty |
ai.thinkTimeMs |
Rapfi's thinking time per move in milliseconds. Range: 100–60000. | 1000 |
Game Records
After each match, a game record is saved in JSON format under config/lunalacegomoku/records/. Records include both players' names, the game mode, enabled forbidden-move rules, all move coordinates, the winner, and the reason for the result.
Additional Notes
-
Multiplayer match data is stored in the block entity, allowing matches to resume after a server restart. AI matches cannot be resumed after a server restart.
-
The interface supports both Chinese and English text.
LunaLace的五子棋
本模组在 Minecraft 中添加了五子棋方块,支持人机对弈、双人对弈与旁观对局。
五子棋方块
-
使用线与任意木板合成:合成格第一行中央放置线,第二行中央放置木板,其余位置留空。
-
在合成物放入背包时(同时持有线与任意木板)解锁配方书配方。
-
生存模式下破坏五子棋方块后掉落方块本体。
对局流程
右键五子棋方块打开主菜单,可选择无禁手对局、有禁手对局、加入房间或旁观对局。
-
有禁手对局:可任选启用长连禁手、四四禁手、三三禁手中的一种或多种,确认后进入模式选择。
-
模式选择:AI 对战或双人对战。
-
AI 对战:可选择己方执黑、执白;在配置了外部 rapfi 引擎后,可进一步选择对局使用的引擎(内置 AI 或 rapfi)。
-
双人对战:房主创建房间后等待其他玩家加入;加入后由房主选择先后手分配(房主执黑、房主执白或随机)。
全部界面右上角设有返回按钮,可退回上一级界面。
游戏规则
-
棋盘为 15×15,黑棋先行,任一方在横线、竖线或斜线方向形成五连即获胜。
-
白棋无禁手,五连或长连均判定为获胜。
-
启用对应禁手规则时,黑棋落子触发禁手立即判负;未启用长连禁手时,黑棋长连同样判定为获胜。
-
悔棋:AI 对局中悔棋立即生效,撤销最近两手(己方与 AI 各一手);双人局中悔棋请求需对方确认后生效。
-
对局结束后可选择重新开始,或通过返回按钮退出对局。
-
战绩显示在界面左上角,记录每位玩家在该方块上的胜局数,随存档保存。
-
观战:其他玩家可实时旁观对局,界面左下角显示观战人数,点击可展开观战名单。
-
对局判定由服务端完成,客户端仅负责显示,落子请求在服务端校验。
AI 引擎
-
内置 AI:模组自带 AI,无需额外配置。
-
rapfi 引擎:模组可通过 piskvork 协议调用开源五子棋引擎 rapfi,使用方法如下。
-
获取 rapfi 的 Windows 可执行文件(pbrain-rapfi),或自行从源码编译。
-
将可执行文件放置于任意路径,并在配置文件中填写完整路径。
-
配置项
ai.thinkTimeMs控制 rapfi 每步思考时长,单位为毫秒,默认值为1000,取值范围为100至60000,修改后需重启游戏生效。
-
-
rapfi 启动失败或未配置时,模组自动回退到内置 AI。
配置
配置文件为 config/lunalacegomoku-common.toml;使用版本隔离的启动器中,位于对应版本目录的 config 文件夹内。
| 配置项 | 说明 | 默认值 |
|---|---|---|
ai.rapfiPath |
rapfi 引擎可执行文件路径,留空使用内置 AI | 空 |
ai.thinkTimeMs |
rapfi 每步思考时长(毫秒),范围 100 至 60000 | 1000 |
棋局记录
每局结束后,对局记录以 JSON 格式保存于 config/lunalacegomoku/records/ 目录,内容包括对局双方名称、对局模式、禁手规则、全部落子坐标、胜者与胜负原因。
其他说明
-
双人局数据保存在方块实体中,服务端重启后可继续进行;AI 对局在服务端重启后不会恢复。
-
界面文本支持中文与英文。

