OpManager
一款安全且轻量级的 OP 管理插件,在授予临时操作员权限时保存并恢复玩家数据。
由 RedCity Industries | Gamer100309 创建
? 描述
OpManager 是一款专为服务器管理员设计的 Minecraft 插件,用于在不丢失当前游戏进度的情况下临时授予自己 OP 权限。与传统 OP 命令不同,OpManager 会在授予 OP 之前保存你的物品栏、位置、游戏模式等数据,并在你完成操作后恢复所有内容。
适用于:
- ?️ 进行服务器维护而不丢失生存进度
- ? 无缝切换管理员和玩家模式
- ? 支持白名单的安全临时 OP 访问
- ? 多种存储策略以满足不同的服务器需求
✨ 功能
核心功能
- ? 完整数据备份:保存物品栏、护甲、副手、位置、游戏模式、经验值、生命值、饥饿度和药水效果
- ? 一键恢复:移除 OP 时自动恢复所有数据
- ? 返回命令:传送到保存的位置,无需移除 OP
- ? 物品栏恢复:仅恢复物品栏,同时保持 OP 状态
- ? 白名单系统:控制谁可以使用此插件
- ? 多语言支持:内置英文和德文支持(易于扩展)
- ? 灵活存储:可选择仅内存、仅磁盘或混合存储
- ? Vanish 集成:可选的
/opoff 时自动禁用隐身
安全功能
- ⚠️ 物品重复警告:如果在 OP 期间死亡,会提醒玩家存在物品重复的风险
- ? 详细日志:提供详细的调试模式以进行故障排除
- ? 自动清理:执行
/opoff 后删除临时文件
- ?️ 数据完整性:对物品进行深度克隆,防止意外修改
? 安装
- 从 Releases 下载最新的
OpManager.jar
- 将文件放入服务器的
plugins/ 文件夹中
- 重启服务器
- 根据需要配置
plugins/OpManager/config.yml
- 将受信任的玩家添加到白名单中
- 使用
/reload 重新加载或重启服务器
? 命令
| 命令 |
描述 |
别名 |
/opon |
授予 OP 并保存当前的玩家数据 |
/op-on, /enableop |
/opoff |
移除 OP 并恢复保存的玩家数据 |
/op-off, /disableop |
/opreturnback |
传送回保存的位置(保持 OP 状态) |
/opreturn, /opback |
/opRestoreInventory |
恢复保存的物品栏,不移除 OP |
/oprestore, /opinv |
⚙️ 配置
快速设置
# 设置语言
language: en # 或 'de' 表示德语
# 启用/禁用物品栏保存
inventory_save: true # false = 仅保存位置和游戏模式
# 白名单保护
whitelist_enabled: true
whitelist:
- YourUsername
- TrustedAdmin
# 存储策略
storage_strategy: DISK_AND_MEMORY # MEMORY_ONLY, DISK_ONLY, 或 DISK_AND_MEMORY
存储策略
| 策略 |
速度 |
数据丢失风险 |
使用场景 |
MEMORY_ONLY |
⚡ 最快 |
⚠️ 高(崩溃、重启时丢失) |
仅限测试 |
DISK_ONLY |
? 较慢 |
✅ 低 |
频繁重启的服务器 |
DISK_AND_MEMORY |
⚡ 快 |
✅ 极低 |
推荐用于大多数服务器 |
Vanish 集成
# 警告:仅在您的隐身插件有专用“关闭”命令时启用
auto_disable_vanish: false
vanish_disable_command: "vanish off {player}"
⚠️ 重要提示:如果您的隐身插件使用的是切换命令(如 /vanish 或 /v),请将 auto_disable_vanish 设置为 false,以避免在您打算禁用隐身时意外启用它!
? 多语言支持
OpManager 开箱即用地支持多种语言:
- ?? English (
messages_en.yml)
- ?? German (
messages_de.yml)
添加自己的语言
- 复制
messages_en.yml 或 messages_de.yml
- 将其重命名为
messages_<code>.yml(例如法语为 messages_fr.yml)
- 翻译文件中的所有消息
- 在
config.yml 中设置 language: fr
- 重新加载插件
? 安全与权限
白名单系统
OpManager 使用基于白名单的权限系统:
whitelist_enabled: true # 设置为 false 以允许所有玩家(不推荐!)
whitelist:
- AdminName
- TrustedModerator
⚠️ 安全警告:如果 whitelist_enabled: false,任何玩家都可以给自己授予 OP!
最佳实践
- ✅ 在生产环境中始终保持
whitelist_enabled: true
- ✅ 仅将受信任的管理员添加到白名单中
- ✅ 定期审查白名单
- ✅ 使用
DISK_AND_MEMORY 存储以确保数据安全
⚠️ 重要警告
物品重复风险
如果你在活动的 OP 会话期间死亡,你的物品会在死亡地点掉落。当你使用 /opoff 时,你保存的物品将被恢复。这意味着你可以捡起掉落的物品并且拥有保存的物品,从而导致物品重复!
防止重复的方法:
- 先使用
/opoff(恢复你保存的物品)
- 然后决定:忽略掉落的物品或捡起它们
如果你在一次 OP 会话期间死亡,插件会在聊天中提醒你。
隐身切换警告
如果你的隐身插件使用的是切换命令(一个命令开启/关闭),设置 auto_disable_vanish: true 可能会意外启用隐身而不是禁用它!
安全的命令(专用关闭):
vanish off {player} ✅
sv off {player} ✅
有风险命令(切换):
vanish {player} ❌
v {player} ❌
? 性能与资源占用
RAM 占用
OpManager 极其轻量级:
| 场景 |
内存占用 |
1 名玩家执行 /opon |
~40 KB(最坏情况) |
| 10 名玩家同时在线 |
~400 KB |
| 100 名玩家同时在线 |
~4 MB |
在实际使用中,由于物品栏未填满且附魔较少,大多数会话每位玩家仅使用 10-20 KB。
对比
- OpManager(1 名玩家):40 KB
- 一个已加载的 Minecraft 区块:~200 KB
- 典型的 Minecraft 服务器:2-8 GB
结论:与服务器整体资源使用情况相比,OpManager 的内存占用几乎可以忽略不计。
? 故障排除
启用详细日志记录
如需获取详细的调试信息,请启用详细日志记录:
verbose_logging: true
这将显示以下方面的详细信息:
- 数据保存/加载操作
- 物品栏复制步骤
- 位置恢复
- 存储操作
常见问题
Q:我的数据没有保存!
A:检查你是否在白名单中,以及 config.yml 中是否设置了 inventory_save: true
Q:死亡后物品重复了!
A:这是预期行为。请在拾取掉落物品前始终使用 /opoff。
Q:隐身模式变成了开启而不是关闭!
A:你的隐身插件使用的是切换命令。请在 config.yml 中设置 auto_disable_vanish: false
Q:服务器崩溃后数据丢失!
A:如果使用 MEMORY_ONLY 存储,这是预期行为。请切换到 DISK_AND_MEMORY 以确保安全。
? 技术细节
保存内容
当你运行 /opon 且 inventory_save: true 时:
- ✅ 完整物品栏(36 个槽位)
- ✅ 护甲(4 个槽位)
- ✅ 副手物品(1 个槽位)
- ✅ 位置(世界、x、y、z、偏航角、俯仰角)
- ✅ 游戏模式(生存、创造、冒险、旁观者)
- ✅ 经验值(等级和进度)
- ✅ 生命值
- ✅ 饥饿值与饱和度
- ✅ 药水效果(类型、持续时间、放大器)
当 inventory_save: false 时:
存储位置
- RAM:存储在 Java HashMap 中(最快,易失性)
- 磁盘:
plugins/OpManager/playerdata/<username>.yml(持久化,执行 /opoff 后自动删除)
? 示例工作流程
1. 你正在玩生存模式:/opon
→ 你的生存数据被保存
→ 你获得 OP 权限
2. 在创造模式下进行管理员工作
→ 建造、传送、使用 WorldEdit 等
3. 管理员任务完成:/opoff
→ OP 权限被移除
→ 你被传回生存模式的位置
→ 你的生存物品栏、游戏模式、经验值等将被恢复
→ 回到你离开时的确切状态继续玩生存模式!
? 贡献
欢迎贡献!你可以:
欢迎提交拉取请求! 请确保:
- Fork 仓库
- 创建功能分支 (
git checkout -b feature/AmazingFeature)
- 提交更改 (
git commit -m 'Add some AmazingFeature')
- 推送到分支 (
git push origin feature/AmazingFeature)
- 打开拉取请求
? 许可证
本项目遵循 GNU General Public License v3.0 许可证。
这意味着:
- ✅ 你可以自由使用、修改和分发此插件
- ✅ 你也必须在 GPL v3 下共享你的修改
- ✅ 分发时必须提供源代码
- ❌ 你不能在未提供源代码的情况下出售此插件
请参阅 LICENSE 文件以获取完整详情,或访问
? 支持
如有其他问题,欢迎在 GitHub 上发起讨论!
? 致谢
创建者:RedCity Industries | Gamer100309
版本:4.1
Minecraft 版本:26.2
API 版本:26.2
⭐ Star 历史
如果你觉得此插件有用,请考虑在 GitHub 上给它一颗星!
由 RedCity Industries 用 ❤️ 制作
OpManager
A safe and lightweight OP management plugin that saves and restores player data when granting temporary operator permissions.
Created by RedCity Industries | Gamer100309
? Description
OpManager is a Minecraft plugin designed for server administrators who need to temporarily grant themselves OP permissions without losing their current gameplay progress. Unlike traditional OP commands, OpManager saves your inventory, position, gamemode, and more before granting OP, then restores everything when you're done.
Perfect for:
- ?️ Server maintenance without losing your survival progress
- ? Switching between admin and player modes seamlessly
- ? Secure temporary OP access with whitelist support
- ? Multiple storage strategies for different server needs
✨ Features
Core Features
- ? Complete Data Backup: Saves inventory, armor, offhand, position, gamemode, XP, health, hunger, and potion effects
- ? One-Click Restore: Automatically restores everything when you remove OP
- ? Return Command: Teleport back to your saved position without removing OP
- ? Inventory Recovery: Restore only your inventory while keeping OP active
- ? Whitelist System: Control who can use the plugin
- ? Multi-Language: Built-in English and German support (easily expandable)
- ? Flexible Storage: Choose between RAM-only, disk-only, or hybrid storage
- ? Vanish Integration: Optional automatic vanish disable on /opoff
Safety Features
- ⚠️ Item Duplication Warning: Alerts players about potential duplication if they die during OP sessions
- ? Verbose Logging: Detailed debug mode for troubleshooting
- ? Automatic Cleanup: Temporary files are deleted after /opoff
- ?️ Data Integrity: Deep cloning of items prevents unintended modifications
? Installation
- Download the latest
OpManager.jar from Releases
- Place the file in your server's
plugins/ folder
- Restart your server
- Configure
plugins/OpManager/config.yml to your needs
- Add trusted players to the whitelist
- Reload with
/reload or restart the server
? Commands
| Command |
Description |
Aliases |
/opon |
Grants OP and saves your current player data |
/op-on, /enableop |
/opoff |
Removes OP and restores your saved player data |
/op-off, /disableop |
/opreturnback |
Teleports you back to your saved position (keeps OP) |
/opreturn, /opback |
/opRestoreInventory |
Restores your saved inventory without removing OP |
/oprestore, /opinv |
⚙️ Configuration
Quick Setup
# Set your language
language: en # or 'de' for German
# Enable/disable inventory saving
inventory_save: true # false = only saves position & gamemode
# Whitelist protection
whitelist_enabled: true
whitelist:
- YourUsername
- TrustedAdmin
# Storage strategy
storage_strategy: DISK_AND_MEMORY # MEMORY_ONLY, DISK_ONLY, or DISK_AND_MEMORY
Storage Strategies
| Strategy |
Speed |
Data Loss Risk |
Use Case |
MEMORY_ONLY |
⚡ Fastest |
⚠️ High (crashes, restarts) |
Testing only |
DISK_ONLY |
? Slower |
✅ Low |
Servers with frequent restarts |
DISK_AND_MEMORY |
⚡ Fast |
✅ Very Low |
Recommended for most servers |
Vanish Integration
# WARNING: Only enable if your vanish plugin has a dedicated "OFF" command
auto_disable_vanish: false
vanish_disable_command: "vanish off {player}"
⚠️ Important: If your vanish plugin uses a toggle command (like /vanish or /v), leave auto_disable_vanish set to false to avoid accidentally enabling vanish when you meant to disable it!
? Multi-Language Support
OpManager supports multiple languages out of the box:
- ?? English (
messages_en.yml)
- ?? German (
messages_de.yml)
Adding Your Own Language
- Copy
messages_en.yml or messages_de.yml
- Rename it to
messages_<code>.yml (e.g., messages_fr.yml for French)
- Translate all messages in the file
- Set
language: fr in config.yml
- Reload the plugin
? Security & Permissions
Whitelist System
OpManager uses a whitelist-based permission system:
whitelist_enabled: true # Set to false to allow ALL players (not recommended!)
whitelist:
- AdminName
- TrustedModerator
⚠️ Security Warning: If whitelist_enabled: false, ANY player can grant themselves OP!
Best Practices
- ✅ Always keep
whitelist_enabled: true in production
- ✅ Only add trusted administrators to the whitelist
- ✅ Regularly review your whitelist
- ✅ Use
DISK_AND_MEMORY storage for data safety
⚠️ Important Warnings
Item Duplication Risk
If you die during an active OP session, your items will drop at your death location. When you use /opoff, your saved items will be restored. This means you could pick up the dropped items AND have your saved items, resulting in item duplication!
To prevent duplication:
- Use
/opoff FIRST (restores your saved items)
- Then decide: ignore the dropped items or pick them up
The plugin will warn you in chat if you die during an OP session.
Vanish Toggle Warning
If your vanish plugin uses a toggle command (one command to turn on/off), setting auto_disable_vanish: true could accidentally enable vanish instead of disabling it!
Safe commands (dedicated OFF):
vanish off {player} ✅
sv off {player} ✅
Risky commands (toggle):
vanish {player} ❌
v {player} ❌
? Performance & Resource Usage
RAM Usage
OpManager is extremely lightweight:
| Scenario |
RAM Usage |
1 player with /opon |
~40 KB (worst case) |
| 10 players simultaneously |
~400 KB |
| 100 players simultaneously |
~4 MB |
In practice, most sessions use only 10-20 KB per player due to partially filled inventories and fewer enchantments.
Comparison
- OpManager (1 player): 40 KB
- One loaded Minecraft chunk: ~200 KB
- Typical Minecraft server: 2-8 GB
Conclusion: OpManager's memory footprint is negligible compared to your server's overall resource usage.
? Troubleshooting
Enable Verbose Logging
For detailed debug information, enable verbose logging:
verbose_logging: true
This will show detailed information about:
- Data saving/loading operations
- Inventory copying steps
- Position restoration
- Storage operations
Common Issues
Q: My data wasn't saved!
A: Check if you're on the whitelist and if inventory_save: true in config.yml
Q: Items duplicated after death!
A: This is expected behavior. Always use /opoff before collecting dropped items.
Q: Vanish turned ON instead of OFF!
A: Your vanish plugin uses a toggle command. Set auto_disable_vanish: false in config.yml
Q: Data lost after server crash!
A: If using MEMORY_ONLY storage, this is expected. Switch to DISK_AND_MEMORY for safety.
? Technical Details
What Gets Saved
When you run /opon with inventory_save: true:
- ✅ Full inventory (36 slots)
- ✅ Armor (4 slots)
- ✅ Offhand (1 slot)
- ✅ Position (world, x, y, z, yaw, pitch)
- ✅ Gamemode (survival, creative, adventure, spectator)
- ✅ Experience (level and progress)
- ✅ Health
- ✅ Hunger & saturation
- ✅ Potion effects (type, duration, amplifier)
With inventory_save: false:
- ✅ Position
- ✅ Gamemode
- ❌ Everything else
Storage Locations
- RAM: Stored in Java HashMap (fastest, volatile)
- Disk:
plugins/OpManager/playerdata/<username>.yml (persistent, auto-deleted after /opoff)
? Example Workflow
1. You're playing survival: /opon
→ Your survival data is saved
→ You receive OP permissions
2. Do admin work in creative mode
→ Build, teleport, use WorldEdit, etc.
3. Done with admin tasks: /opoff
→ OP is removed
→ You're teleported back to your survival location
→ Your survival inventory, gamemode, XP, etc. are restored
→ Back to playing survival exactly where you left off!
? Contributing
Contributions are welcome! Feel free to:
Pull Requests are welcome! Please make sure to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature)
- Commit your changes (
git commit -m 'Add some AmazingFeature')
- Push to the branch (
git push origin feature/AmazingFeature)
- Open a Pull Request
? License
This project is licensed under the GNU General Public License v3.0.
What this means:
- ✅ You can use, modify, and distribute this plugin freely
- ✅ You must share your modifications under GPL v3 as well
- ✅ You must provide source code when distributing
- ❌ You cannot sell this plugin without providing the source code
See the LICENSE file for full details or visit
? Support
For general questions, feel free to open a discussion on GitHub!
? Credits
Created by: RedCity Industries | Gamer100309
Version: 4.1
Minecraft Version: 26.2
API Version: 26.2
⭐ Star History
If you find this plugin useful, please consider giving it a star on GitHub!
Made with ❤️ by RedCity Industries
评论 0
登录后参与评分
还没有评论,来抢沙发吧