NullPass 是一款适用于运行 NeoForge 1.21.1 的 Minecraft 服务器的简易身份验证模组。它仅需安装在服务端:玩家可使用普通的兼容客户端加入服务器,无需自行安装该模组。
新玩家需要注册账号,而已注册的玩家在游玩前必须登录。在身份验证完成之前,NullPass 会阻止玩家移动、聊天、使用大部分命令、与世界交互、攻击实体或打开容器。
密码绝不会以明文形式保存。
功能特性
- 仅服务端安装。
- 安全的账号注册与身份验证。
- 使用加盐 PBKDF2 进行密码哈希处理;密码不以明文存储。
- 可配置密码长度限制。
/register 和 /login 命令,支持可选的短别名。
/changepassword 以及可选的 /logout 命令。
- 身份验证前对移动、聊天、命令、交互、物品栏/容器、破坏方块及攻击行为进行限制。
- 支持在聊天栏、动作栏(action bar)或Boss栏中显示身份验证提示。
- 可配置提示重复间隔。
- 可配置注册/登录超时时间;未认证玩家超时后将被踢出。
- 可配置错误登录尝试次数上限。
- 错误密码反馈包含当前尝试次数,例如
(1/3)。
- 可选的已重连玩家会话记忆功能。
- 可选的记忆会话仅限同一 IP 地址。
- 支持自定义消息,使用旧版 Minecraft 颜色代码(
&)。
- 提供英文和俄文语言资源;默认配置消息为俄语。
为什么使用 NullPass?
NullPass 适用于离线模式或私人的 Minecraft 服务器,需要为这些服务器提供基于密码的登录层。它使身份验证流程保持专注且可配置,同时无需每位玩家都安装额外的模组。
当你想要实现以下目标时,请使用 NullPass:
- 保护离线模式服务器上的玩家账号;
- 防止未认证玩家与世界交互;
- 强制实施登录截止时间并限制密码猜测尝试;
- 在正常重连后提供便捷的重连会话恢复期;
- 自定义所有面向玩家的提示消息及其显示位置。
基础语法
| 命令 |
描述 |
/register <password> <confirmPassword> |
创建账号并验证玩家身份。 |
/login <password> |
验证已注册玩家的登录。 |
/changepassword <oldPassword> <newPassword> |
更改已验证玩家的密码。 |
/logout |
结束当前的身份验证会话(需在配置中启用)。 |
/reg <password> <confirmPassword> |
/register 的短别名(需启用 shortCommands)。 |
/l <password> |
/login 的短别名(需启用 shortCommands)。 |
密码作为单个命令参数读取,因此不能包含空格。
配置
NullPass 使用 NeoForge 通用配置文件。模组首次启动后,请编辑服务器 config 目录中生成的 nullpass-common.toml 文件,然后重启服务器以应用更改。
主要选项
| 选项 |
默认值 |
描述 |
shortCommands |
true |
启用 /reg 和 /l 别名。 |
sessionExpireSeconds |
60 |
正常重连时可恢复已验证会话的时间长度。设为 0 以禁用记忆会话功能。 |
requireSameIpForSession |
true |
要求重连玩家使用相同的 IP 地址以恢复会话。 |
messageDisplay |
ACTIONBAR |
注册/登录提示的显示位置:CHAT、ACTIONBAR 或 BOSSBAR。 |
messageRepeatSeconds |
3 |
提示重复间隔。设为 0 以禁用重复提示。 |
allowLogoutCommand |
true |
允许玩家使用 /logout。 |
authenticationTimeoutSeconds |
60 |
用于注册或登录的可用时间。设为 0 以禁用超时。 |
maxLoginAttempts |
3 |
断开玩家连接前的最大错误 /login 尝试次数。设为 0 以禁用此限制。 |
password.minLength |
4 |
允许的密码最小长度。 |
password.maxLength |
32 |
允许的密码最大长度。 |
示例
shortCommands = true
sessionExpireSeconds = 60
requireSameIpForSession = true
messageDisplay = "ACTIONBAR"
messageRepeatSeconds = 3
allowLogoutCommand = true
authenticationTimeoutSeconds = 60
maxLoginAttempts = 3
[password]
minLength = 4
maxLength = 32
消息与颜色
所有面向玩家的消息均可在 messages 部分进行修改。NullPass 支持使用 & 的旧版颜色代码,例如:
[messages]
login = "&6NullPass &7| &fPlease log in: /login <password>"
wrongPassword = "&6NullPass &7| &cIncorrect password."
authenticationTimeout = "&6NullPass &7| &fYou did not authenticate."
loginAttemptsExceeded = "&6NullPass &7| &fThe maximum number of login attempts has been exceeded."
当启用 maxLoginAttempts 时,错误密码消息会在最后一次失败尝试前自动附加一个灰色的计数器:
NullPass | Incorrect password. (1/3)
NullPass | Incorrect password. (2/3)
在最后一次失败尝试时,玩家将因达到上限而被断开连接,并显示配置的 loginAttemptsExceeded 消息。
安装
- 在你的服务器上为 Minecraft 1.21.1 安装 NeoForge。
- 将 NullPass JAR 文件放入服务器的
mods 目录。
- 启动服务器一次以生成配置文件。
- 如有需要,编辑
config/nullpass-common.toml。
- 重启服务器。
客户端无需安装 NullPass。
NullPass is a simple authentication mod for Minecraft servers running NeoForge 1.21.1. It requires installation on the server only: players can join with a normal compatible client and do not need to install the mod themselves.
New players must register an account, while registered players must log in before playing. Until authentication is completed, NullPass prevents the player from moving, chatting, using most commands, interacting with the world, attacking entities, or opening containers.
Passwords are never saved as plain text.
Features
- Server-side-only installation.
- Secure account registration and authentication.
- Salted PBKDF2 password hashing; passwords are not stored in plain text.
- Configurable password length limits.
/register and /login commands, with optional short aliases.
/changepassword and optional /logout commands.
- Movement, chat, command, interaction, inventory/container, block-breaking, and attack restrictions before authentication.
- Authentication prompts in chat, the action bar, or a boss bar.
- Configurable prompt repeat interval.
- Configurable registration/login timeout; unauthenticated players are kicked when it expires.
- Configurable limit for incorrect login attempts.
- Incorrect-password feedback with the current attempt count, such as
(1/3).
- Optional remembered sessions for reconnecting players.
- Optional same-IP requirement for remembered sessions.
- Customizable messages with legacy Minecraft color codes (
&).
- English and Russian language resources; default configuration messages are Russian.
Why Use NullPass?
NullPass is useful for offline-mode or private Minecraft servers where players need a password-based login layer. It keeps the authentication flow focused and configurable without requiring every player to install an extra mod.
Use it when you want to:
- protect player accounts on an offline-mode server;
- prevent unauthenticated players from interacting with the world;
- enforce a login deadline and limit password-guessing attempts;
- offer a convenient session-resume period after normal reconnects;
- customize all player-facing messages and prompt placement.
Base Syntax
| Command |
Description |
/register <password> <confirmPassword> |
Creates an account and authenticates the player. |
/login <password> |
Authenticates a registered player. |
/changepassword <oldPassword> <newPassword> |
Changes the password of an authenticated player. |
/logout |
Ends the current authentication session, if enabled in the configuration. |
/reg <password> <confirmPassword> |
Short alias for /register, if shortCommands is enabled. |
/l <password> |
Short alias for /login, if shortCommands is enabled. |
Passwords are read as single command arguments, so they cannot contain spaces.
Configuration
NullPass uses the NeoForge common configuration file. After the mod has started once, edit the generated nullpass-common.toml file in your server's config directory, then restart the server to apply changes.
Main Options
| Option |
Default |
Description |
shortCommands |
true |
Enables /reg and /l aliases. |
sessionExpireSeconds |
60 |
How long a normal reconnect can resume an authenticated session. Set 0 to disable remembered sessions. |
requireSameIpForSession |
true |
Requires the reconnecting player to use the same IP address for session resume. |
messageDisplay |
ACTIONBAR |
Where the registration/login prompt is shown: CHAT, ACTIONBAR, or BOSSBAR. |
messageRepeatSeconds |
3 |
Prompt repeat interval. Set 0 to disable repeated prompts. |
allowLogoutCommand |
true |
Allows players to use /logout. |
authenticationTimeoutSeconds |
60 |
Time available to register or log in. Set 0 to disable the timeout. |
maxLoginAttempts |
3 |
Maximum incorrect /login attempts before the player is disconnected. Set 0 to disable the limit. |
password.minLength |
4 |
Minimum allowed password length. |
password.maxLength |
32 |
Maximum allowed password length. |
Example
shortCommands = true
sessionExpireSeconds = 60
requireSameIpForSession = true
messageDisplay = "ACTIONBAR"
messageRepeatSeconds = 3
allowLogoutCommand = true
authenticationTimeoutSeconds = 60
maxLoginAttempts = 3
[password]
minLength = 4
maxLength = 32
Messages and Colors
Every player-facing message can be changed under the messages section. NullPass supports legacy color codes using &, for example:
[messages]
login = "&6NullPass &7| &fPlease log in: /login <password>"
wrongPassword = "&6NullPass &7| &cIncorrect password."
authenticationTimeout = "&6NullPass &7| &fYou did not authenticate."
loginAttemptsExceeded = "&6NullPass &7| &fThe maximum number of login attempts has been exceeded."
When maxLoginAttempts is enabled, a wrong-password message automatically receives a gray counter before the final failed attempt:
NullPass | Incorrect password. (1/3)
NullPass | Incorrect password. (2/3)
On the final failed attempt, the player is disconnected with the configured loginAttemptsExceeded message instead.
Installation
- Install NeoForge for Minecraft 1.21.1 on your server.
- Place the NullPass JAR in the server's
mods directory.
- Start the server once to generate the configuration file.
- Edit
config/nullpass-common.toml if needed.
- Restart the server.
Clients do not need NullPass installed.
评论 0
登录后参与评分
还没有评论,来抢沙发吧