** TotemDisabler 插件
? 概述
TotemDisabler 是一款轻量级、高性能的 Minecraft Paper/Spigot 插件,可完全从服务器中移除不死图腾。它确保玩家无法获得、使用或持有不死图腾,使死亡成为不可逆的后果,并为游戏玩法增添硬核生存元素。
? 描述
不死图腾是 Minecraft 中强大的物品,能够防止玩家死亡。虽然它们为原版游戏增添了刺激感,但许多服务器管理员希望:
- 创造更具挑战性的生存体验
- 防止 PvP 战斗中的不公平优势
- 在不使用硬核模式的情况下实现类似硬核的玩法
- 平衡经济类服务器中因图腾打破进度平衡的问题
TotemDisabler 通过彻底消除所有可能来源的图腾来解决此问题。该插件采用纯事件驱动架构,无任何计划任务,确保对服务器的影响降至最低。
✨ 功能
| 功能 |
描述 |
| ? 唤魔者掉落阻止 |
击杀唤魔者时不再掉落不死图腾 |
| ? 世界生成阻止 |
图腾无法在世界任何地方作为物品生成 |
| ? 登录库存扫描 |
玩家登录时移除其背包中的图腾 |
| ⚙️ 简单配置 |
config.yml 中单个开关即可启用/禁用 |
| ? 游戏内切换命令 |
管理员无需编辑文件即可切换设置 |
| ? 基于权限的访问 |
仅限管理员的安全命令访问 |
| ⚡ 零延迟设计 |
纯事件驱动,无调度器或循环 |
| ? 轻量级 |
资源占用极少且文件体积小 |
? 应用场景
-
硬核生存服务器
让死亡变得有意义。没有图腾后,玩家在危险情境下必须更加谨慎和具有策略性。
-
PvP 服务器
在战斗中实现公平竞争。战斗中不再有“开图腾”带来的优势。实力决定胜负。
-
经济类服务器
防止囤积和交易图腾导致服务器经济失衡。
-
挑战类服务器
创建独特挑战,让玩家无法依赖图腾作为安全网。
-
角色扮演服务器
通过从世界观 lore 中移除“魔法复活”物品来保持沉浸感。
-
无政府服务器(修改版)
即使在规则最少的服务器上,也为游戏玩法增加额外风险。
-
活动服务器
运行特殊活动或比赛,其中死亡是最终的。
?️ 工作原理
┌─────────────────────────────────────────────────────────────┐
│ 图腾阻止系统 │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ EntityDeathEvent ┌──────────────┐ │
│ │ 唤魔者 │ ──────────────────────▶│ 移除掉落列表 │ │
│ │ 死亡 │ └──────────────┘ │
│ └─────────────┘ │
│ │
│ ┌─────────────┐ ItemSpawnEvent ┌──────────────┐ │
│ │ 图腾物品 │ ──────────────────────▶│ 事件 │ │
│ │ 生成 │ │ 已取消 │ │
│ └─────────────┘ └──────────────┘ │
│ │
│ ┌─────────────┐ PlayerJoinEvent ┌──────────────┐ │
│ │ 玩家 │ ──────────────────────▶│ 移除图腾 │ │
│ │ 加入 │ └──────────────┘ │
│ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
? 命令
| 命令 |
描述 |
权限 |
/totemtoggle |
切换图腾禁用的开启/关闭状态 |
totemdisabler.admin |
命令输出示例:
================================
TotemDisabler 配置已更新!
totems-disabled: true → false
重启后图腾将处于启用状态(原版行为)。
⚠ 更改将在服务器重启后生效。
================================
? 权限
| 权限 |
描述 |
默认值 |
totemdisabler.admin |
访问 /totemtoggle 命令 |
OP |
⚙️ 配置
config.yml
TotemDisabler 配置
当设置为 true 时,不死图腾将被完全禁用。
- 唤魔者不会掉落图腾
- 图腾无法在世界中作为物品生成
- 玩家登录时会从背包中移除图腾
当设置为 false 时,恢复原版行为。
注意:更改需要重启服务器才能生效。
totems-disabled: true
| 选项 |
类型 |
默认值 |
描述 |
totems-disabled |
布尔值 |
true |
启用/禁用图腾阻止 |
? 性能
| 指标 |
值 |
| 计划任务 |
0 |
| Tick 监听器 |
0 |
| 事件监听器 |
3 (仅在启用时) |
| 内存占用 |
极小 |
| CPU 使用率 |
可忽略不计 |
使用的优化技术:
- ✅ 针对非相关实体的提前返回检查
- ✅ 事件优先级设置为 HIGHEST 以确保可靠性
- ✅ ignoreCancelled 标志以尊重其他插件
- ✅ 条件性监听器注册(禁用时无监听器)
- ✅ 无需持久数据存储
- ✅ 无需数据库连接
? 安装
- 下载
TotemDisabler-1.0.0.jar
- 放入服务器的
plugins/ 文件夹
- 重启服务器
- (可选)编辑
plugins/TotemDisabler/config.yml
- 如果进行了更改,请再次重启服务器
? 技术规格
| 规格 |
值 |
| 插件名称 |
TotemDisabler |
| 版本 |
1.0.0 |
| API 版本 |
1.21 |
| Java 版本 |
21+ |
| 服务器软件 |
Paper / Spigot |
| Minecraft 版本 |
1.21.1 - 1.21.x |
| 依赖项 |
无 |
| 软依赖项 |
无 |
? 测试清单
| 测试项 |
预期结果 |
| 击杀唤魔者 |
不掉落不死图腾 |
/give @p totem_of_undying 然后重新登录 |
物品栏中的不死图腾被移除 |
| 将不死图腾掉落在地上 |
物品瞬间消失 |
| 在主手以外的槽位持有不死图腾并重新登录 |
不死图腾被移除 |
使用 /totemtoggle |
配置切换,显示提示信息 |
设置 totems-disabled: false 并重启服务器 |
恢复原版行为 |
❓ 常见问题
问:这会影响箱子里已有的不死图腾吗?
答: 不会。该插件仅在玩家加入时从玩家物品栏中移除不死图腾,并阻止新的不死图腾生成。箱子里的不死图腾在玩家拾取并重新登录之前保持不变。
问:玩家还能使用 /give 获得不死图腾吗?
答: 可以,但他们在重新登录时不死图腾会被移除。若要完全禁止,请使用权限插件来阻止不死图腾的 /give 命令。
问:这兼容 Folia 吗?
答: 此插件专为 Paper/Spigot 设计。不保证与 Folia 兼容。
问:为什么更改开关需要重启?
答: 监听器仅在启动时注册一次。动态注册/注销可能会与其他插件及事件处理产生冲突。
问:这会影响不死图腾的声音和粒子效果吗?
答: 不会。由于不死图腾被完全移除,复活效果永远不会触发。
? 更新日志
版本 1.0.0
- 首次发布
- 防止唤魔者掉落
- 阻止物品生成
- 玩家加入时扫描物品栏
- 提供切换命令
- 支持配置文件
适用于: Minecraft Paper/Spigot 1.21.x
享受无不死图腾的 Minecraft 体验! ?⚔️
** TotemDisabler Plugin
? Overview
TotemDisabler is a lightweight, high-performance Minecraft Paper/Spigot plugin that completely removes Totems of Undying from your server. It ensures totems cannot be obtained, used, or possessed by any player, making death a permanent consequence and adding a hardcore survival element to your gameplay.
? Description
Totems of Undying are powerful items in Minecraft that prevent player death. While they add excitement to vanilla gameplay, many server owners want to:
- Create a more challenging survival experience
- Prevent unfair advantages in PvP combat
- Implement hardcore-style gameplay without using hardcore mode
- Balance economy servers where totems break progression
TotemDisabler solves this by completely eliminating totems from every possible source. The plugin uses a purely event-driven architecture with zero scheduled tasks, ensuring minimal server impact.
✨ Features
| Feature |
Description |
| ? Evoker Drop Prevention |
Evokers no longer drop Totems of Undying when killed |
| ? World Spawn Blocking |
Totems cannot spawn as items anywhere in the world |
| ? Join Inventory Scan |
Removes totems from players when they log in |
| ⚙️ Simple Configuration |
Single toggle in config.yml to enable/disable |
| ? In-Game Toggle Command |
Admins can toggle settings without editing files |
| ? Permission-Based Access |
Secure admin-only command access |
| ⚡ Zero Lag Design |
Pure event-driven, no schedulers or loops |
| ? Lightweight |
Minimal resource usage and small file size |
? Use Cases
-
Hardcore Survival Servers
Make death meaningful again. Without totems, players must be more careful and strategic in dangerous situations.
-
PvP Servers
Level the playing field in combat. No more totem-popping advantages during fights. Skill determines the winner.
-
Economy Servers
Prevent totem hoarding and trading that could unbalance your server economy.
-
Challenge Servers
Create unique challenges where players cannot rely on totems as a safety net.
-
Roleplay Servers
Maintain immersion by removing "magical resurrection" items from your world's lore.
-
Anarchy Servers (Modified)
Add extra risk to gameplay even on servers with minimal rules.
-
Event Servers
Run special events or competitions where death is final.
?️ How It Works
┌─────────────────────────────────────────────────────────────┐
│ TOTEM BLOCKING SYSTEM │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ EntityDeathEvent ┌──────────────┐ │
│ │ Evoker │ ──────────────────────▶│ Drop Removed │ │
│ │ Dies │ │ from List │ │
│ └─────────────┘ └──────────────┘ │
│ │
│ ┌─────────────┐ ItemSpawnEvent ┌──────────────┐ │
│ │ Totem Item │ ──────────────────────▶│ Event │ │
│ │ Spawns │ │ Cancelled │ │
│ └─────────────┘ └──────────────┘ │
│ │
│ ┌─────────────┐ PlayerJoinEvent ┌──────────────┐ │
│ │ Player │ ──────────────────────▶│ Totems │ │
│ │ Joins │ │ Removed │ │
│ └─────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
? Commands
| Command |
Description |
Permission |
/totemtoggle |
Toggles totem disabling on/off |
totemdisabler.admin |
Command Output Example:
================================
TotemDisabler config updated!
totems-disabled: true → false
Totems will be ENABLED after restart (vanilla behavior).
⚠ Changes will take effect after the server restarts.
================================
? Permissions
| Permission |
Description |
Default |
totemdisabler.admin |
Access to /totemtoggle command |
OP |
⚙️ Configuration
config.yml
TotemDisabler Config
When set to true, Totems of Undying are completely disabled.
- Evokers will not drop totems
- Totems cannot spawn as items in the world
- Totems are removed from player inventories on join
When set to false, vanilla behavior is restored.
NOTE: Changes require a server restart to take effect.
totems-disabled: true
| Option |
Type |
Default |
Description |
totems-disabled |
Boolean |
true |
Enable/disable totem blocking |
? Performance
| Metric |
Value |
| Scheduled Tasks |
0 |
| Tick Listeners |
0 |
| Event Listeners |
3 (only when enabled) |
| Memory Footprint |
Minimal |
| CPU Usage |
Negligible |
Optimization Techniques Used:
- ✅ Early return checks for non-relevant entities
- ✅ Event priority set to HIGHEST for reliability
- ✅ ignoreCancelled flag to respect other plugins
- ✅ Conditional listener registration (disabled = no listeners)
- ✅ No persistent data storage required
- ✅ No database connections
? Installation
- Download
TotemDisabler-1.0.0.jar
- Place in your server's
plugins/ folder
- Restart the server
- (Optional) Edit
plugins/TotemDisabler/config.yml
- Restart again if you made changes
? Technical Specifications
| Specification |
Value |
| Plugin Name |
TotemDisabler |
| Version |
1.0.0 |
| API Version |
1.21 |
| Java Version |
21+ |
| Server Software |
Paper / Spigot |
| Minecraft Versions |
1.21.1 - 1.21.x |
| Dependencies |
None |
| Soft Dependencies |
None |
? Testing Checklist
| Test |
Expected Result |
| Kill an Evoker |
No totem drops |
/give @p totem_of_undying then relog |
Totem removed from inventory |
| Drop totem on ground |
Item disappears instantly |
| Hold totem in off-hand and relog |
Totem removed |
Use /totemtoggle |
Config flips, message shown |
Set totems-disabled: false and restart |
Vanilla behavior restored |
❓ FAQ
Q: Will this affect existing totems in chests?
A: No. The plugin only removes totems from player inventories on join and prevents new totems from spawning. Totems in chests remain until a player picks them up and relogs.
Q: Can players still use /give for totems?
A: Yes, but the totem will be removed when they relog. For complete prevention, use permission plugins to block the give command for totems.
Q: Does this work with Folia?
A: This plugin is designed for Paper/Spigot. Folia compatibility is not guaranteed.
Q: Why require a restart for toggle changes?
A: Listeners are registered once at startup. Dynamic registration/unregistration could cause issues with other plugins and event handling.
Q: Does this affect Totem sound/particles?
A: No. Since totems are completely removed, the totem resurrection effect never triggers.
? Changelog
Version 1.0.0
- Initial release
- Evoker drop prevention
- Item spawn blocking
- Player join inventory scan
- Toggle command
- Configuration support
Built For: Minecraft Paper/Spigot 1.21.x
Enjoy a totem-free Minecraft experience! ?⚔️**
评论 0
登录后参与评分
还没有评论,来抢沙发吧