PlayerImmortal
一款轻量级的 Bukkit/Spigot/Paper 插件,为管理员(OP)提供上帝模式免疫,使其免受任何伤害来源的伤害。
PlayerImmortal 是一款极简主义插件,允许 OP 玩家为自己切换无敌状态。激活后,玩家不会死亡——生命值永远不会低于 1 颗心(半颗心)。非常适合需要测试机制而无需担心死亡风险的服务器管理员,或在危险环境中工作的建筑者。
? 目录
? 简介
PlayerImmortal 旨在为服务器操作员提供一种简单、无冗余的方式来实现临时无敌。虽然其他插件中已存在创造模式或 /god 命令,但本插件专注于简洁性和轻量级性能——它只做一件事,并且做得很好。
它的设计对象包括:
- 服务器管理员 – 需要在不死的情况下测试红石、战斗或跑酷。
- 建筑者 – 在生存模式下工作,但不想被怪物或坠落打断。
- 插件开发者 – 希望获得一个最小的 Bukkit 事件监听器和命令示例。
主要用例:
- 通过单个命令快速切换无敌状态。
- 在游戏机制测试期间保持存活。
- 在服务器维护期间避免意外死亡。
✨ 功能
- ?️ 切换无敌 – 使用
/immortal 开启或关闭上帝模式。
- ❤️ 生命下限 – 生命值永远不会降至 1.0 HP 以下,从而防止死亡。
- ? 仅限操作员 – 只有拥有 OP 特权的玩家才能使用该命令。
- ⚡ 轻量级 – 无配置文件、无数据库、无臃肿代码。
- ? 兼容性强 – 适用于 Bukkit、Spigot 和 Paper 1.21.*。
- ? 零依赖 – 纯 Bukkit API,无外部库。
? 安装
手动安装(JAR 文件)
- 从 Modrinth 页面下载最新的
PlayerImmortal.jar。
- 将 JAR 文件放入服务器的
plugins/ 文件夹中。
- 重启服务器(或使用插件管理器如
/reload – 尽管建议完全重启)。
? 快速开始
- 启动服务器并安装该插件。
- 成为 OP(如果尚未拥有):
/op YourName
- 切换无敌状态:
/immortal
- 首次执行:
§aImmortal on – 你现在处于无敌状态。
- 再次执行:
§cImmortal off – 无敌状态已禁用。
- 测试效果 – 从高崖跳下或让僵尸攻击你;你的生命值永远不会归零。
? 命令与权限
| 命令 |
权限 |
描述 |
/immortal |
(无需权限 – 仅限 OP) |
切换执行玩家的无敌状态。 |
- 该命令不需要特定的权限节点;它检查发送者是否为 OP (
player.isOp())。
- 只有玩家能执行此命令 – 控制台发送者将被拒绝。
- 该插件不暴露任何其他命令或子命令。
⚙️ 配置
PlayerImmortal 不使用配置文件。
所有行为均为硬编码以实现简洁性。无需调整设置 – 只需放入并使用即可。
如果您希望自定义消息或添加权限,请考虑 Fork 该项目并修改源代码。
? 从源码构建
如果您更喜欢自行构建插件:
- 克隆仓库:
git clone https://github.com/yourusername/PlayerImmortal.git
cd PlayerImmortal
- 确保您已安装 Java 17+ 和 Maven。
- 构建:
mvn clean package
- 编译后的 JAR 文件将位于
target/PlayerImmortal-{version}.jar。将其复制到服务器的 plugins/ 文件夹中。
❓ 常见问题
问:这是否适用于 1.21 以外的版本?
答:该插件是基于 1.21.1 API 构建的。它可能在支持 EntityDamageEvent API 的旧版本上也能运行,但我们仅官方支持 1.21.*。
问:我可以将该命令授予非 OP 玩家吗?
答:目前不行。该插件明确检查 player.isOp()。如果需要基于权限的控制,您可以修改源代码或使用带有包装器的权限插件。
问:当我开启无敌时会发生什么?
答:您将收到消息 §aImmortal on。当伤害原本会导致您死亡时,您的生命值将被限制在 1.0 HP。您仍然会受到伤害,但不会死亡。
问:它是否适用于其他伤害来源(坠落、火焰、虚空等)?
答:是的,它通过减少伤害使得生命值永远不会达到 0 来取消所有 EntityDamageEvent 来源的伤害。
问:我发现了 Bug。在哪里报告?
答:请在 GitHub Issues 页面上打开一个问题,包含复现步骤和您服务器的日志。
? 致谢
? 许可证
本项目依据 GNU 通用公共许可证 v3.0 授权——详细信息请参阅 LICENSE 文件。
由 Mr_Catcraft 用 ❤️ 打造
PlayerImmortal
A lightweight Bukkit/Spigot/Paper plugin that gives operators (OP) god-mode immunity, preventing death from any damage source.
PlayerImmortal is a minimalistic plugin that allows OP players to toggle immortality on themselves. When active, the player cannot die – health will never drop below 1 heart (half a heart). Perfect for server administrators who need to test mechanics without the risk of dying, or for builders in dangerous environments.
? Table of Contents
? About
PlayerImmortal was created to provide a simple, no‑frills way for server operators to enable temporary invulnerability. While creative mode or /god commands exist in other plugins, this plugin focuses on simplicity and lightweight performance – it only does one thing and does it well.
It is designed for:
- Server Administrators – who need to test redstone, combat, or parkour without dying.
- Builders – who work in survival mode but don’t want to be interrupted by mobs or falls.
- Plugin Developers – who want a minimal example of a Bukkit event listener and command.
Key use cases:
- Quickly toggle immortality with a single command.
- Stay alive while testing game mechanics.
- Avoid accidental death during server maintenance.
✨ Features
- ?️ Toggle Immortality – Use
/immortal to turn god-mode on or off.
- ❤️ Health Floor – Health will never drop below 1.0 HP, preventing death.
- ? Operator Only – Only players with OP privileges can use the command.
- ⚡ Lightweight – No configuration files, no database, no bloat.
- ? Compatible – Works on Bukkit, Spigot, and Paper 1.21.*.
- ? Zero Dependencies – Pure Bukkit API, no external libraries.
? Installation
Manual installation (JAR)
- Download the latest
PlayerImmortal.jar from the Modrinth page.
- Place the JAR file into your server's
plugins/ folder.
- Restart your server (or use a plugin manager like
/reload – though a full restart is recommended).
? Quick Start
- Start your server with the plugin installed.
- Become OP (if not already):
/op YourName
- Toggle immortality:
/immortal
- First execution:
§aImmortal on – you are now invincible.
- Second execution:
§cImmortal off – immortality disabled.
- Test it – jump from a high cliff or let a zombie hit you; your health will never reach zero.
? Commands & Permissions
| Command |
Permission |
Description |
/immortal |
(none – OP only) |
Toggles immortality for the executing player. |
- The command does not require a specific permission node; it checks if the sender is OP (
player.isOp()).
- Only players can execute the command – console senders are rejected.
- The plugin does not expose any other commands or subcommands.
⚙️ Configuration
PlayerImmortal does not use a configuration file.
All behaviour is hardcoded for simplicity. There are no settings to adjust – just drop it in and use it.
If you wish to customise messages or add permissions, please consider forking the project and modifying the source.
? Building from Source
If you prefer to build the plugin yourself:
- Clone the repository:
git clone https://github.com/yourusername/PlayerImmortal.git
cd PlayerImmortal
- Ensure you have Java 17+ and Maven installed.
- Build:
mvn clean package
- The compiled JAR will be in
target/PlayerImmortal-{version}.jar. Copy it to your server's plugins/ folder.
❓ FAQ
Q: Does this work on versions other than 1.21?
A: The plugin is built against the 1.21.1 API. It may work on older versions that support the EntityDamageEvent API, but we only officially support 1.21.*.
Q: Can I give the command to non-OP players?
A: Currently, no. The plugin explicitly checks player.isOp(). If you need permission-based control, you can modify the source or use a permission plugin with a wrapper.
Q: What happens when I toggle immortality on?
A: You will receive a message §aImmortal on. Your health will be capped at 1.0 HP when damage would otherwise kill you. You can still take damage, but you cannot die.
Q: Does it work with other damage sources (fall, fire, void, etc.)?
A: Yes, it cancels all EntityDamageEvent sources by reducing the damage so that health never reaches 0.
Q: I found a bug. Where do I report it?
A: Please open an issue on the GitHub Issues page with steps to reproduce and your server logs.
? Acknowledgments
- Bukkit/Spigot/Paper API – for providing the Minecraft server interface.
- All contributors and testers who help improve this plugin.
? License
This project is licensed under the GNU General Public License v3.0 – see the LICENSE file for details.
Built with ❤️ by Mr_Catcraft
评论 0
登录后参与评分
还没有评论,来抢沙发吧