跳到正文

SudoOp

作者:youximi

SudoOp Mod lets normal players on a server grant themselves temporary OP permissions with one command. SudoOp Mod 让服务器普通玩家通过一条命令自助获取临时 OP 权限。

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

SudoOp

English | 中文


English

SudoOp allows normal players on a server to grant themselves temporary OP permissions with one command, with automatic revocation when time expires. Players don’t need any client-side mods, and admins don’t need to manually run /op, /deop, or watch the clock to revoke permissions.

Features

  • One-click authorization: Players type /sudo to get temporary OP, with optional password protection.
  • Automatic revocation: Permissions are revoked when expired; server restart/stop automatically cleans up leftover temporary OPs.
  • Real-time reminders: Broadcast grant/expiry messages server-wide, and show remaining time in the action bar.
  • Highly customizable: Command name, duration, permission level, and broadcast messages can all be changed in the config file.
  • Audit logs: Authorization, denial, expiry, and cleanup events are all logged and traceable.
  • Protects existing admins: Temporary OP players cannot discover or operate on existing OPs via /op or /deop.

Usage

Players type in chat:

  • /sudo # when no password is set
  • /sudo # when password is set
  • Default grants level 2 OP for 600 seconds (real time).
  • Authorization only applies to the player who runs the command.
  • Players who are already existing OPs or already have temporary OP will receive a denial message.

Configuration

Config file located at config/sudoop-server.toml, changes take effect after server restart.

| Config Option | Default | Description |
| — | — | — |
| commandName | "sudo" | Command name |
| durationSeconds | 600 | Duration of temporary OP in seconds |
| opLevel | 2 | Permission level granted (1–4) |
| password | "" | Password required to apply; empty means no password |
| broadcastEnabled | true | Whether to broadcast grant/expiry server-wide |
| actionBarEnabled | true | Whether to show remaining time in action bar |
| grantBroadcastMessage | "&a{player} 获取了临时OP" | Grant broadcast message (default in Chinese) |
| expireBroadcastMessage | "&e{player} 的临时OP已结束" | Expiry broadcast message (default in Chinese) |
| actionBarMessage | "&b当前已获取临时OP,还剩 {minutes} 分钟" | Action bar message (default in Chinese) |

Messages support & or § color codes, and placeholders {player} (player name) and {minutes} (remaining minutes).

Passwords are never shown in chat prompts, broadcasts, logs, or mod logs.

License

MIT


中文

SudoOp 让服务器普通玩家通过一条命令自助获取临时 OP 权限,到期自动回收。玩家无需安装任何客户端模组,管理员也无需手动 /op、/deop 或盯着时间收权。

特性

  • 一键授权:玩家输入 /sudo 即可获取临时 OP,可选密码保护
  • 自动回收:权限到期自动撤销;服务器重启、停止时自动清理遗留的临时 OP
  • 实时提醒:全服广播授权/到期消息,玩家动作栏持续显示剩余时间
  • 高度可定制:命令名、时长、权限等级、广播文案均可在配置文件修改
  • 审计日志:授权、拒绝、到期、清理等事件全部记录在案,可追溯
  • 保护真实管理员:临时 OP 玩家无法通过 /op、/deop 发现或操作后台管理员

使用方法

玩家在聊天栏输入:

  • /sudo # 未设置密码时
  • /sudo # 设置密码后
  • 默认授予 2 级 OP 权限,持续 600 秒(按真实时间计算)
  • 授权仅对执行命令的玩家本人生效
  • 已是后台 OP 或已持有临时 OP 的玩家会收到拒绝提示

配置

配置文件位于 config/sudoop-server.toml,修改后重启服务器生效。

| 配置项 | 默认值 | 说明 |
| — | — | — |
| commandName | "sudo" | 命令名称 |
| durationSeconds | 600 | 临时 OP 持续时长(秒) |
| opLevel | 2 | 授予的权限等级(1–4) |
| password | "" | 申请所需密码,留空表示无需密码 |
| broadcastEnabled | true | 是否全服广播授权/到期 |
| actionBarEnabled | true | 是否在动作栏显示剩余时间 |
| grantBroadcastMessage | "&a{player} 获取了临时OP" | 授权广播文案 |
| expireBroadcastMessage | "&e{player} 的临时OP已结束" | 到期广播文案 |
| actionBarMessage | "&b当前已获取临时OP,还剩 {minutes} 分钟" | 动作栏文案 |

文案支持 & 或 § 颜色代码,以及 {player}(玩家名)、{minutes}(剩余分钟数)占位符。

密码不会出现在聊天提示、广播、日志或模组日志中。

许可证

MIT

常见问题

SudoOp 支持哪些 Minecraft 版本?

SudoOp 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

SudoOp 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅服务端。

评论

登录后评论和评分