2Core
以独立的 JVM 进程运行第二个 Fabric 服务器——一个模组,两种角色。
这是什么?
2Core 允许你通过单个模组在同一台机器上运行两个 Minecraft 服务器。主服务器将次服务器作为外部 JVM 进程启动并管理。两个服务器使用相同的模组 JAR 文件——角色(主或次)在启动时自动确定。
无需插件、代理或额外软件。
功能
- 一个模组,两个服务器 — 安装一次,模组自动处理两种角色
- 跨服聊天同步 — 聊天消息、加入/离开通知和死亡消息在服务器间实时中继
- 玩家列表 —
/listother 显示另一台服务器上的在线玩家(所有玩家可用)
- 完整的进程管理 — 使用简单命令启动、停止、重启次服务器
- 控制台中继 — 可选择将次服务器的控制台输出镜像到主服务器
- 自动启动 — 可选择在主服务器启动时自动启动次服务器
- 可配置的消息 — 独立自定义每个服务器的加入/离开/聊天/死亡消息格式,支持颜色代码(
&6, &a 等)
- 安全的 IPC — 服务器通过仅本地回环的 TCP 套接字通信,无外部暴露风险
要求
|
|
| Minecraft |
1.21.11 |
| Fabric Loader |
≥ 0.18.6 |
| Fabric API |
任意版本 |
| Fabric Language Kotlin |
≥ 1.13.0 |
仅限服务端。无需客户端安装。
设置
- 在你的主服务器上安装该模组(连同 Fabric API 和 Fabric Language Kotlin)
- 启动主服务器 — 模组会创建
2core/ 文件夹和 2core/2core.properties 配置文件
- 将次服务器的文件放入
2core/ 中(或配置 copy_mode 以自动复制它们)
- 运行
/2core start 启动次服务器
模组会自动将其自身复制到 2core/mods/ 中 — 无需在次服务器上单独安装。
命令
双端均可用(所有玩家)
| 命令 |
描述 |
/listother |
显示另一台服务器上的在线玩家 |
管理员命令 — 仅限主服务器 (/2core ...)
| 命令 |
描述 |
/2core start |
启动第二个服务器 |
/2core stop |
停止第二个服务器 |
/2core restart |
重启第二个服务器 |
/2core status |
显示状态、配置和 IPC 连接信息 |
/2core chatlink on|off |
启用或禁用跨服同步 |
/2core console on|off |
切换次服务器控制台中继到主服务器 |
/2core cmd <command> |
向次服务器发送命令 |
/2core set <key> <value> |
更改配置值而无需编辑文件 |
/2core help |
显示命令列表 |
配置
配置文件:2core/2core.properties
| 键 |
默认值 |
描述 |
copy_mode |
none |
none / launcher / full — 如何复制服务器文件到 2core/ |
launcher_jar |
fabric-server-launch.jar |
Fabric 启动器 jar 名称 |
vanilla_jar |
server.jar |
原版服务器 jar 名称 |
port |
25566 |
次服务器的端口 |
max_ram_mb |
1024 |
次服务器 JVM 的最大内存 (-Xmx) |
auto_start |
false |
主服务器启动时自动启动次服务器 |
auto_console |
false |
启动时自动启用控制台中继 |
chat_link |
false |
在服务器间同步聊天、加入、离开和死亡事件 |
ipc_port |
0 |
服务器间通信的 IPC 端口 (0 = 自动) |
join_message_for_primary |
&6%player% joined the second server |
当玩家加入次服务器时,在主服务器显示 |
join_message_for_secondary |
&6%player% joined the main server |
当玩家加入主服务器时,在次服务器显示 |
leave_message_for_primary |
&6%player% left the second server |
当玩家离开次服务器时,在主服务器显示 |
leave_message_for_secondary |
&6%player% left the main server |
当玩家离开主服务器时,在次服务器显示 |
chat_format_for_primary |
&7[&62nd&7] &f<%player%> %message% |
来自次服务器的消息在主服务器的聊天格式 |
chat_format_for_secondary |
&7[&61st&7] &f<%player%> %message% |
来自主服务器的消息在次服务器的聊天格式 |
death_format_for_primary |
&7[&62nd&7] &c%message% |
来自次服务器的死亡消息在主服务器的格式 |
death_format_for_secondary |
&7[&61st&7] &c%message% |
来自主服务器的死亡消息在次服务器的格式 |
占位符:%player%, %message%。颜色代码:&0–&9, &a–&f, &l, &o, &r 等。
工作原理
当主服务器启动时,它会以 -Dtwocore.role=secondary 参数将次服务器作为子 JVM 进程启动。两个 JVM 运行相同的模组 JAR 文件 — 次服务器通过系统属性检测其角色并跳过所有进程管理逻辑。服务器间通信(聊天同步、玩家列表查询)由模组管理的本地回环 TCP 套接字完成。
2Core
Run a second Fabric server as a separate JVM process — one mod, two roles.
What is this?
2Core lets you run two Minecraft servers on the same machine from a single mod. The primary server launches and manages the secondary server as an external JVM process. Both servers use the same mod JAR — the role (primary or secondary) is determined automatically at startup.
No plugins, no proxies, no extra software required.
Features
- One mod, two servers — install once, the mod handles both roles automatically
- Cross-server chat sync — chat messages, join/leave notifications, and death messages are relayed between servers in real time
- Player list —
/listother shows online players on the other server (available to all players)
- Full process management — start, stop, restart the secondary server with simple commands
- Console relay — optionally mirror the secondary server's console output to the primary
- Auto-start — optionally start the secondary server automatically when the primary starts
- Configurable messages — customize join/leave/chat/death message formats independently for each server with color code support (
&6, &a, etc.)
- Safe IPC — servers communicate over a localhost-only TCP socket, no external exposure
Requirements
|
|
| Minecraft |
1.21.11 |
| Fabric Loader |
≥ 0.18.6 |
| Fabric API |
any |
| Fabric Language Kotlin |
≥ 1.13.0 |
Server-side only. No client installation needed.
Setup
- Install the mod on your primary server (along with Fabric API and Fabric Language Kotlin)
- Start the primary server — the mod creates a
2core/ folder and a 2core/2core.properties config file
- Place your secondary server files inside
2core/ (or configure copy_mode to copy them automatically)
- Run
/2core start to launch the secondary server
The mod copies itself into 2core/mods/ automatically — no need to install it separately on the secondary.
Commands
Available on both servers (all players)
| Command |
Description |
/listother |
Show online players on the other server |
Admin commands — primary server only (/2core ...)
| Command |
Description |
/2core start |
Start the second server |
/2core stop |
Stop the second server |
/2core restart |
Restart the second server |
/2core status |
Show status, config, and IPC connection info |
/2core chatlink on|off |
Enable or disable cross-server sync |
/2core console on|off |
Toggle secondary console relay to primary |
/2core cmd <command> |
Send a command to the secondary server |
/2core set <key> <value> |
Change a config value without editing the file |
/2core help |
Show command list |
Configuration
Config file: 2core/2core.properties
| Key |
Default |
Description |
copy_mode |
none |
none / launcher / full — how to copy server files to 2core/ |
launcher_jar |
fabric-server-launch.jar |
Fabric launcher jar name |
vanilla_jar |
server.jar |
Vanilla server jar name |
port |
25566 |
Port for the secondary server |
max_ram_mb |
1024 |
Max RAM for the secondary JVM (-Xmx) |
auto_start |
false |
Start secondary automatically when primary starts |
auto_console |
false |
Enable console relay automatically on startup |
chat_link |
false |
Sync chat, join, leave, and death events between servers |
ipc_port |
0 |
IPC port for inter-server communication (0 = auto) |
join_message_for_primary |
&6%player% joined the second server |
Shown on primary when a player joins the secondary |
join_message_for_secondary |
&6%player% joined the main server |
Shown on secondary when a player joins the primary |
leave_message_for_primary |
&6%player% left the second server |
Shown on primary when a player leaves the secondary |
leave_message_for_secondary |
&6%player% left the main server |
Shown on secondary when a player leaves the primary |
chat_format_for_primary |
&7[&62nd&7] &f<%player%> %message% |
Chat format on primary for messages from secondary |
chat_format_for_secondary |
&7[&61st&7] &f<%player%> %message% |
Chat format on secondary for messages from primary |
death_format_for_primary |
&7[&62nd&7] &c%message% |
Death message format on primary from secondary |
death_format_for_secondary |
&7[&61st&7] &c%message% |
Death message format on secondary from primary |
Placeholders: %player%, %message%. Color codes: &0–&9, &a–&f, &l, &o, &r, etc.
How it works
When the primary server starts, it launches the secondary server as a child JVM process with -Dtwocore.role=secondary. Both JVMs run the same mod JAR — the secondary detects its role via the system property and skips all process management logic. Inter-server communication (chat sync, player list queries) happens over a localhost TCP socket managed by the mod.
评论 0
登录后参与评分
还没有评论,来抢沙发吧