Minecraft 登录模组
Minecraft 1.21.1 · NeoForge · 仅服务端 · 无需安装客户端组件
Login For Minecraft 是一款轻量级的服务端认证模组,提供账户注册、安全登录、会话保护、位置恢复以及玩家传送请求等功能。
它专为希望建立自托管认证系统而不依赖外部登录插件的服务器所有者设计。玩家无需在客户端进行任何安装操作。
功能概览
- ? 完整的注册与登录系统
- ? 自动恢复每位玩家的上次位置
- ? 保留维度、坐标和旋转角度
- ? 内置
/tpa 和 /tpahere 传送请求系统
- ?️ 登录前限制移动和交互行为
- ⚙️ 可配置超时时间、尝试次数上限及等待位置
- ?️ 完全基于服务端,无客户端依赖
账户认证
Login For Minecraft 提供了所有必要的账户管理命令。
| 命令 |
描述 |
/register <password> <confirmPassword> |
注册新账户 |
/login <password> |
登录已有账户 |
/l <password> |
/login 的简短别名 |
/logout |
登出并保存当前位置 |
/changePassword <oldPassword> <newPassword> |
更改账户密码 |
/unregister <password> |
永久注销账户 |
/account |
查看个人账户信息 |
安全特性
- 密码以加盐 SHA-256 哈希值存储,绝不以明文形式保存
- 可配置登录超时时间,超时后自动断开连接
- 可配置最大失败登录尝试次数
- 未认证玩家只能使用
/login 和 /register 命令
- 登录前禁用方块破坏、实体交互、物品栏及物品交互
- 成功认证后,临时限制将自动清除
智能位置恢复
Login For Minecraft 会记录每位玩家离开服务器时的位置,并在其下次成功登录后恢复该位置。
首次登录
首次登录的玩家将被传送到主世界(Overworld)的默认出生点。
返回玩家
返回的玩家将被传送到其上次保存的位置,包括:
- 维度
- X、Y 和 Z 坐标
- Yaw(偏航角)
- Pitch(俯仰角)
玩家位置会在以下情况保存:
- 玩家断开连接时
- 玩家使用
/logout 命令时
- 服务器关闭时
如果之前保存的维度已不存在,玩家将被安全地传送到默认出生点。
玩家传送请求
内置的 TPA 系统允许玩家请求传送,无需额外安装工具类模组。
| 命令 |
描述 |
/tpa <player> |
请求传送到另一位玩家处 |
/tpahere <player> |
请求另一位玩家传送到你所在的位置 |
/tpaccept [player] |
接受传送请求,可选指定发送者 |
/tpdeny [player] |
拒绝传送请求 |
/tpacancel |
取消你发送的所有传送请求 |
TPA 行为
- 只有在接收方玩家同意后才会执行传送
- 请求在可配置的时段后自动过期
- 默认请求有效期为 60 秒
- 可同时处理多个传入请求
- 玩家可以接受或拒绝来自特定发送者的请求
防护与反作弊措施
在认证完成前,玩家处于受限状态:
- 移动被锁定在配置的等待位置
- 玩家在等待期间无敌
- 禁用方块破坏与放置
- 禁用实体交互
- 禁用物品栏及物品交互
- 除注册和登录外,其他命令均被阻止
这些限制有助于防止未认证玩家影响游戏世界,或被用于刷怪农场和环境利用等漏洞 exploit。
所有临时玩家状态在登录或登出后都会正确恢复。
配置
配置文件自动生成于以下路径:
config/loginforminecraft-common.toml
查看默认配置
# === 登录等待位置 ===
# true:
# 使用专用的登录维度,未认证玩家
# 将悬浮在类似虚空的区域中,无法进行交互。
#
# false:
# 使用下方配置的维度和坐标。
spawn.useLoginDimension = true
spawn.dimension = "minecraft:overworld"
spawn.x = 0.0
spawn.y = 500.0
spawn.z = 0.0
spawn.yaw = 0.0
spawn.pitch = 0.0
# === 认证设置 ===
# 登录超时时间(秒)。
# 设置为 0 则禁用超时。
auth.loginTimeoutSeconds = 180
# 最大失败密码尝试次数。
auth.maxLoginAttempts = 5
# 必须始终使用离线认证的列表。
auth.forcedOfflinePlayers = []
# === TPA 设置 ===
# 启用或禁用 TPA 系统。
tpa.enabled = true
# 传送请求有效期(秒)。
tpa.requestTimeoutSeconds = 60
兼容性
| 要求 |
详情 |
| Minecraft |
1.21.1 |
| 加载器 |
NeoForge |
| 环境 |
专用服务器 |
| 客户端安装 |
不需要 |
| 额外依赖 |
无 |
安装
- 为 Minecraft 1.21.1 安装 NeoForge 服务器。
- 下载 Login For Minecraft 的 JAR 文件。
- 将 JAR 文件放入服务器的
mods 目录。
- 启动服务器。
- 如需自定义,编辑
config/loginforminecraft-common.toml。
- 修改配置后重启服务器。
当玩家加入服务器时,他们将自动收到注册或登录提示。
[!IMPORTANT]
此模组仅需安装在服务器上。玩家可使用未经修改的 Minecraft 客户端连接。
更新
在安装新版本之前:
- 停止服务器。
- 备份服务器世界、账户数据和配置文件。
- 替换现有的模组 JAR 文件。
- 启动服务器,并查看控制台中关于迁移或配置的消息。
支持
在报告问题时,请包含以下内容:
- Minecraft 版本
- NeoForge 版本
- 模组版本
- 相关的服务器日志
- 重现问题的步骤
切勿在错误报告中包含密码、账户凭证或其他敏感信息。
Login For Minecraft
Minecraft 1.21.1 · NeoForge · Server-side only · No client installation required
Login For Minecraft is a lightweight, server-side authentication mod that provides account registration, secure login, session protection, location restoration, and player teleport requests.
It is designed for server owners who want a self-hosted authentication system without relying on external login plugins. Players do not need to install anything on their clients.
Features at a Glance
- ? Complete registration and login system
- ? Automatic restoration of each player's last location
- ? Dimension, coordinates, and rotation are preserved
- ? Built-in
/tpa and /tpahere request system
- ?️ Movement and interaction restrictions before login
- ⚙️ Configurable timeouts, attempt limits, and waiting locations
- ?️ Fully server-side with no client-side dependencies
Account Authentication
Login For Minecraft provides all essential account-management commands.
| Command |
Description |
/register <password> <confirmPassword> |
Register a new account |
/login <password> |
Log in to an existing account |
/l <password> |
Short alias for /login |
/logout |
Log out and preserve the current location |
/changePassword <oldPassword> <newPassword> |
Change the account password |
/unregister <password> |
Permanently unregister the account |
/account |
View personal account information |
Security Features
- Passwords are stored as salted SHA-256 hashes, never as plaintext
- Configurable login timeout with automatic disconnection
- Configurable maximum number of failed login attempts
- Unauthenticated players can only use
/login and /register
- Block, entity, inventory, and item interactions are disabled before login
- Temporary restrictions are cleared automatically after successful authentication
Smart Location Restoration
Login For Minecraft remembers where each player left the server and restores that position after their next successful login.
First Login
Players logging in for the first time are teleported to the default spawn point in the Overworld.
Returning Players
Returning players are teleported to their last saved location, including:
- Dimension
- X, Y, and Z coordinates
- Yaw
- Pitch
Player locations are saved when:
- The player disconnects
- The player uses
/logout
- The server shuts down
If a previously saved dimension no longer exists, the player is safely returned to the default spawn point.
Player Teleport Requests
The built-in TPA system allows players to request teleportation without requiring a separate utility mod.
| Command |
Description |
/tpa <player> |
Request to teleport to another player |
/tpahere <player> |
Request that another player teleport to you |
/tpaccept [player] |
Accept a request, optionally from a specific player |
/tpdeny [player] |
Deny a teleport request |
/tpacancel |
Cancel all teleport requests you have sent |
TPA Behavior
- Teleportation only occurs after the receiving player accepts
- Requests expire automatically after a configurable period
- The default request lifetime is 60 seconds
- Multiple incoming requests can be handled simultaneously
- Players can accept or deny a request from a specific sender
Protection and Anti-Exploit Measures
Before authentication, players are placed in a restricted state:
- Movement is locked at the configured waiting location
- Players are invulnerable while waiting
- Block breaking and placement are disabled
- Entity interaction is disabled
- Inventory and item interaction is disabled
- Commands other than registration and login are blocked
These restrictions help prevent unauthenticated players from affecting the world or being used for mob-farm and environmental exploits.
All temporary player states are correctly restored after login or logout.
Configuration
The configuration file is generated automatically at:
config/loginforminecraft-common.toml
View the default configuration
# === Login Waiting Location ===
# true:
# Use a dedicated login dimension where unauthenticated players
# remain suspended in a void-like area and cannot interact.
#
# false:
# Use the configured dimension and coordinates below.
spawn.useLoginDimension = true
spawn.dimension = "minecraft:overworld"
spawn.x = 0.0
spawn.y = 500.0
spawn.z = 0.0
spawn.yaw = 0.0
spawn.pitch = 0.0
# === Authentication Settings ===
# Login timeout in seconds.
# Set to 0 to disable the timeout.
auth.loginTimeoutSeconds = 180
# Maximum number of failed password attempts.
auth.maxLoginAttempts = 5
# Players who must always use offline authentication.
auth.forcedOfflinePlayers = []
# === TPA Settings ===
# Enable or disable the TPA system.
tpa.enabled = true
# Teleport request lifetime in seconds.
tpa.requestTimeoutSeconds = 60
Compatibility
| Requirement |
Details |
| Minecraft |
1.21.1 |
| Mod loader |
NeoForge |
| Environment |
Dedicated server |
| Client installation |
Not required |
| Additional dependencies |
None |
Installation
- Install a NeoForge server for Minecraft 1.21.1.
- Download the Login For Minecraft JAR file.
- Place the JAR file in the server's
mods directory.
- Start the server.
- Edit
config/loginforminecraft-common.toml if customization is needed.
- Restart the server after changing the configuration.
When players join, they will automatically receive a registration or login prompt.
[!IMPORTANT]
This mod only needs to be installed on the server. Players can connect using an unmodified Minecraft client.
Updating
Before installing a new version:
- Stop the server.
- Back up the server world, account data, and configuration.
- Replace the existing mod JAR.
- Start the server and review the console for migration or configuration messages.
Support
When reporting an issue, include:
- Minecraft version
- NeoForge version
- Mod version
- Relevant server logs
- Steps required to reproduce the problem
Never include passwords, account credentials, or other sensitive information in bug reports.
评论 0
登录后参与评分
还没有评论,来抢沙发吧