mc-multilogin-compat-mod
一个用于 Minecraft 1.21.1(Mojang 映射表)的 Fabric 服务端模组,可与 MC-MultiLogin-service 集成。
建议配合 Authlib-Injector 使用。此模组仅修改登录方式和登录失败时的提示信息。如果您使用 Authlib-Injector,请记得设定它的链接为 MC-MultiLogin-service 提供的 API 地址。
Velocity 插件版本
配置文件位于 plugins\multilogin-auth-compat\multilogin-compat-config.json。
Fabric 模组版本
功能特性
- 每次玩家登录时,模组会调用配置的 MC-MultiLogin-service 端点,并附带
detail=true 参数,因此认证失败时会返回结构化的 JSON 错误信息,而不是通用的“Failed to verify username!”(验证用户名失败!)提示。
- 详细的错误原因(如
DUPLICATE_NAME、BANNED、NOT_FOUND 等)会直接转发给正在连接的客户端,显示在断开连接界面中。
DUPLICATE_NAME 时的自动重命名(可配置):当服务报告某个玩家名称已被另一个皮肤站账户占用时,模组会自动使用服务建议的 availableId(例如 Steve_2)重试登录,并将原始名称 → 新名称的映射记录到 config/mc-multilogin-renames.json 中。
设置
- 将模组 JAR 文件放入服务器的
mods/ 目录中。
- 启动服务器一次——默认配置文件将在
config/mc-multilogin-compat.json 生成,并且服务器会因错误而停止,要求你填写 API URL。
- 编辑配置文件,将
apiUrl 设置为你的 MC-MultiLogin-service 方法入口的基础 URL(例如 http://127.0.0.1:25600/login/my)。
- 重新启动服务器。
配置 (config/mc-multilogin-compat.json)
{
"apiUrl": "http://127.0.0.1:25600/login/my",
"autoRename": true
}
| 字段 |
类型 |
默认值 |
说明 |
apiUrl |
string |
"" |
必填。 MC-MultiLogin-service 登录方法的基础 URL(例如在 method[].url 下配置的路径)。模组会自动追加 /session/minecraft/hasJoined?…。 |
autoRename |
boolean |
true |
(当前不可用)当值为 true 时,若收到 DUPLICATE_NAME 拒绝响应,将使用服务返回的 availableId 自动重试。重命名结果会持久化保存到 config/mc-multilogin-renames.json。设为 false 可禁用此功能并显示错误信息。 |
构建
# 需要 Java 21 以及访问 maven.fabricmc.net 的网络权限
./gradlew build
输出的 JAR 文件位于 build/libs/ 目录中。
mc-multilogin-compat-mod
A Fabric server-side mod for Minecraft 1.21.1 (Mojang mappings) that integrates with
MC-MultiLogin-service.
一个用于 Minecraft 1.21.1(Mojang 映射表)的 Fabric 服务端模组,用于与 MC-MultiLogin-service 集成,可以实现多源登录方式。
We suggest you to use this with Authlib-Injector. This mod only change the login method and the login-failed message.
建议配合 Authlib-Injector 使用。此模组仅修改登录方式和登录失败时的提示信息。如果您使用Authlib-Injector,请记得设定它的链接为 MC-MultiLogin-service提供的API地址。
Velocity Plugin Version
Config can be found at plugins\multilogin-auth-compat\multilogin-compat-config.json.
配置可以在plugins\multilogin-auth-compat\multilogin-compat-config.json找到。
Fabric Mod Version
Features
- On every player login the mod calls the configured MC-MultiLogin-service endpoint with
detail=true, so authentication failures return a structured JSON error instead of the
generic "Failed to verify username!" message.
- Detailed error reasons (
DUPLICATE_NAME, BANNED, NOT_FOUND, …) are forwarded directly
to the connecting client in the disconnect screen.
- Auto-rename on
DUPLICATE_NAME (configurable): when the service reports that a player
name is already taken by another skin-site account, the mod automatically retries the login
with the service-suggested availableId (e.g. Steve_2) and records the
original → new-name mapping in config/mc-multilogin-renames.json.
Setup
- Place the mod JAR in your server's
mods/ directory.
- Start the server once – a default config file will be generated at
config/mc-multilogin-compat.json and the server will stop with an error asking you
to fill in the API URL.
- Edit the config and set
apiUrl to the base URL of your MC-MultiLogin-service method
entry (e.g. http://127.0.0.1:25600/login/my).
- Restart the server.
Configuration (config/mc-multilogin-compat.json)
{
"apiUrl": "http://127.0.0.1:25600/login/my",
"autoRename": true
}
| Field |
Type |
Default |
Description |
apiUrl |
string |
"" |
Required. Base URL of the MC-MultiLogin-service login method (e.g. the path configured under method[].url). The mod appends /session/minecraft/hasJoined?… automatically. |
autoRename |
boolean |
true |
(Not working at present) When true, a DUPLICATE_NAME rejection triggers an automatic retry using the availableId returned by the service. The rename is persisted in config/mc-multilogin-renames.json. Set to false to disable and show the error instead. |
Building
# Requires Java 21 and internet access to maven.fabricmc.net
./gradlew build
The output JAR will be in build/libs/.
评论 0
登录后参与评分
还没有评论,来抢沙发吧