OpLogin
OpLogin 是一个 Paper 插件,它允许操作员账号在正常游戏中保持可用,同时将操作员权限锁定在认证之后。操作员加入服务器时处于锁定状态,仅在需要时解锁,并自动或手动返回受保护状态。
功能特性
- 锁定的操作员会话:在认证之前禁用操作员权限。
- 使用 BCrypt 存储密码,支持一次性迁移以兼容旧版 AES 加密条目。
- 聊天安全的密码登录流程:输入
/oplogin 启动登录,随后发送的下一条聊天消息将被私密捕获作为密码。
- 可选的 PIN 键盘模式,具有随机化的数字位置自定义数字头像。
- 支持手动
/oplogout,立即锁定权限并清除可信 IP 自动登录状态。
- 敏感命令保护:即使白名单配置有误,也会拦截高风险命令。
- 临时解锁超时及可选的敏感命令后自动锁定功能。
- 失败的登录尝试跟踪与临时封禁。
- 操作员命令审计日志记录。
- 紧急
/oplockdown 命令,强制所有在线操作员重新回到锁定状态。
- 可信 IP 自动登录支持,但仅在成功认证登录后才生效。
命令
/opsetpass <player> <password>
仅限控制台。设置或替换操作员凭证。
/oplogin
启动认证。在密码模式下,下一条聊天消息将被视为密码;在 PIN 模式下会打开一个键盘 GUI。
/oplogout
立即锁定当前操作员会话,并清除该操作员已记住的 IP 登录信息。
/resetop <player>
仅限控制台。移除操作员凭证。
/opreload
仅限控制台。重载配置文件和白名单数据。
/oplockdown
仅限控制台。强制所有在线操作员回到锁定状态。
认证模式
密码模式
- 默认模式。
- 操作员输入
/oplogin,然后在聊天中键入密码。
- 密码长度必须满足
security.min-password-length 的要求。
PIN 模式
- 可选功能,默认关闭。
- 操作员输入
/oplogin 后会收到一个随机排列的数字键盘 GUI。
- 存储的凭证必须是纯数字,且长度需匹配
security.pin-mode.length 的设置。
- 键盘中的数字头像纹理素材来自 minecraft-heads.com。

重要模式变更行为
- 在密码模式和 PIN 模式之间切换时,下次启动服务器或执行
/opreload 会重置所有已存储的操作员凭证和可信 IP 条目。
- 这是有意为之的设计,以防止文本密码在 PIN 模式下继续有效,同时确保仅 PIN 模式的凭证不会带入密码模式。
安装
- 下载最新的 jar 文件。
- 将其放入服务器的
plugins 目录中。
- 启动服务器一次,以生成
config.yml 和 whitelist.yml。
- 配置插件,然后重载或重启服务器。
配置
config.yml
相关选项:
security:
min-password-length: 8
max-login-attempts: 3
block-duration: 15
enable-ip-auto-login: true
unlock-duration-seconds: 300
auto-lock-ops-on-join: true
pin-mode:
enabled: false
length: 4
title: '&8OpLogin PIN'
说明:
enable-ip-auto-login 仅在成功认证登录后才会记住 IP 地址。
- 使用
/oplogout 会立即清除该操作员已记住的 IP 信息。
- 如果启用了 PIN 模式,通过
/opsetpass 设置的凭证必须是纯数字,且长度需与配置的 PIN 长度一致。
whitelist.yml
在此列出的命令即使在锁定状态下仍可使用,除非是始终被拦截直到认证的敏感命令。
默认示例:
whitelisted-commands:
- help
- oplogin
- list
- ping
使用方法
设置凭证
从控制台使用 /opsetpass <player> <password>。
登录
使用 /oplogin。
登出
使用 /oplogout 在不退出服务器的情况下重新锁定权限。
重置凭证
从控制台使用 /resetop <player>。
兼容性
- Minecraft: Paper 1.21.x
- Java: 21
致谢
OpLogin
OpLogin is a Paper plugin that keeps operator accounts usable for normal gameplay while locking operator privileges behind authentication. Operators join in a locked state, unlock only when needed, and return to a protected state automatically or manually.
Features
- Locked operator sessions that disable operator privileges until authentication.
- BCrypt password storage with one-time migration support for older AES-encrypted entries.
- Chat-safe password login flow:
/oplogin starts login and the next chat message is captured privately.
- Optional PIN keypad mode with randomized digit positions and custom number heads.
- Manual
/oplogout support that immediately locks privileges and clears trusted IP auto-login state.
- Sensitive command protection that overrides whitelist mistakes for high-risk commands.
- Temporary unlock timeouts and optional auto-locking after sensitive commands.
- Failed login attempt tracking with temporary blocking.
- Operator command audit logging.
- Emergency
/oplockdown command to force all online operators back into the locked state.
- Trusted IP auto-login support that only applies after a successful authenticated login.
Commands
/opsetpass <player> <password>
Console-only. Sets or replaces an operator credential.
/oplogin
Starts authentication. In password mode the next chat message is treated as the password. In PIN mode a keypad GUI opens.
/oplogout
Locks the current operator session immediately and clears remembered IP login for that operator.
/resetop <player>
Console-only. Removes an operator credential.
/opreload
Console-only. Reloads config and whitelist data.
/oplockdown
Console-only. Forces all online operators back into the locked state.
Authentication Modes
Password Mode
- Default mode.
- Operators use
/oplogin, then type their password in chat.
- Passwords must meet
security.min-password-length.
PIN Mode
- Optional and disabled by default.
- Operators use
/oplogin and receive a randomized keypad GUI.
- Stored credentials must be numeric and match
security.pin-mode.length.
- Number head textures in the keypad use assets from minecraft-heads.com.

Important Mode Change Behavior
- Switching between password mode and PIN mode resets all stored operator credentials and trusted IP entries on the next startup or
/opreload.
- This is intentional so text passwords cannot remain active in PIN mode, and PIN-only credentials do not carry over into password mode.
Installation
- Download the latest jar.
- Place it in the server
plugins directory.
- Start the server once to generate
config.yml and whitelist.yml.
- Configure the plugin and reload or restart the server.
Configuration
config.yml
Relevant options:
security:
min-password-length: 8
max-login-attempts: 3
block-duration: 15
enable-ip-auto-login: true
unlock-duration-seconds: 300
auto-lock-ops-on-join: true
pin-mode:
enabled: false
length: 4
title: '&8OpLogin PIN'
Notes:
enable-ip-auto-login remembers the IP only after a successful authenticated login.
- Using
/oplogout clears the remembered IP for that operator immediately.
- If PIN mode is enabled, credentials set with
/opsetpass must be numeric and match the configured PIN length.
whitelist.yml
Commands listed here can still be used while locked, except for sensitive commands that are always blocked until authentication.
Default example:
whitelisted-commands:
- help
- oplogin
- list
- ping
Usage
Set a Credential
Use /opsetpass <player> <password> from the console.
Log In
Use /oplogin.
Log Out
Use /oplogout to re-lock privileges without leaving the server.
Reset a Credential
Use /resetop <player> from the console.
Compatibility
- Minecraft: Paper 1.21.x
- Java: 21
Credits
评论 0
登录后参与评分
还没有评论,来抢沙发吧