AntiNetherite 插件
AntiNetherite 是一款高度可配置的 Minecraft 插件,旨在从玩家背包中移除下界合金物品,并阻止其制作、装备或使用下界合金物品进行攻击。插件的每个方面都可以启用、禁用或微调,以适应您服务器的需求。
默认情况下,该插件以非破坏性模式运行(enable-destructive-actions: false)。在非破坏性模式下,它仅阻止使用下界合金物品而不销毁它们,在强制执行服务器规则的同时对玩家更加友好。您可以通过将 enable-destructive-actions: true 切换至破坏性模式,这将把物品从背包中移除、删除掉落物,并从生成的战利品表中过滤掉被阻止的物品。
功能
- 完全可配置的保护系统 - 每个功能均可单独启用或禁用
- 提供非破坏性模式 - 可选择移除物品或仅阻止其使用
- 定期从玩家背包中移除下界合金物品
- 取消下界合金物品的制作
- 防止装备下界合金护甲
- 防止使用下界合金武器进行攻击
- 防止拾取下界合金物品
- 移除掉落的下界合金物品
- 防止在背包中移动下界合金物品
- 阻止自动化容器(漏斗)传输下界合金物品(可配置,默认禁用以避免性能影响)
- 从生成的战利品表中过滤掉被阻止的下界合金物品,同时保留配置的资源掉落
- 当挖掘或生成时,用下界岩替换远古残骸
- 性能优化 - 控制是否在插件禁用时恢复已替换的远古残骸
- 细粒度控制 - 针对内存使用、日志记录等的高级设置
- 可自定义的下界合金物品检测
- 创造/旁观者模式排除 - 可选忽略处于创造或旁观者模式的玩家
- 可配置的玩家通知 - 控制是否通知玩家被阻止的操作
- 完全兼容 Folia 1.21.4,使用区域感知调度器
- 游戏内命令用于管理所有设置
- 支持热重载,无需重启服务器即可更改配置
从生成的战利品表中移除的其他物品
# 这些是 Bukkit Material 枚举名称
# 当 inherit-detection-items(继承检测物品)为 false 时,这将作为完整的战利品表黑名单
# 原版 Minecraft 目前不包含下界合金狼甲;如果你的服务器软件或自定义内容提供它,请在此处添加
# NETHERITE_WOLF_ARMOR
items:
- NETHERITE_SWORD
- NETHERITE_PICKAXE
- NETHERITE_AXE
- NETHERITE_SHOVEL
- NETHERITE_HOE
# - NETHERITE_SPEAR # 根据版本取消注释,应已被模式匹配覆盖
- NETHERITE_HELMET
- NETHERITE_CHESTPLATE
- NETHERITE_LEGGINGS
- NETHERITE_BOOTS
# - NETHERITE_HORSE_ARMOR # 同上
# - NETHERITE_NAUTILUS_ARMOR # 同上
- NETHERITE_BLOCK
- NETHERITE_UPGRADE_SMITHING_TEMPLATE
# 不应被战利品表过滤移除的物品
# 这允许服务器阻止生成的下界合金装备,同时允许像远古残骸、碎屑和锭这样的资源类掉落物
preserve-items:
- ANCIENT_DEBRIS
- NETHERITE_SCRAP
- NETHERITE_INGOT
==============================
远古残骸设置
==============================
ancient-debris:
# 挖掘时是否用下界岩替换远古残骸?
# 此选项可防止玩家获得远古残骸
replace-when-mined: true
# 区块加载时是否用下界岩替换远古残骸?
# 此选项可防止远古残骸在世界中生成
# 首次加载时可能会导致卡顿
replace-on-chunk-load: false
# 是否仅替换已生成的区块中的远古残骸?
# 如果为 true,则仅处理已生成的区块
# 如果为 false,则无论生成状态如何,所有区块都会被处理
only-replace-generated-chunks: true
# 尝试替换远古残骸时,是否确保区块已加载?
# 如果为 true,若区块未加载则会自动加载
# 如果为 false,则仅处理已加载的区块
ensure-chunks-loaded: false
# 是否保存被替换的远古残骸的位置?
# 如果为 true,插件将跟踪并保存被替换的远古残骸位置
# 如果为 false,远古残骸将被替换但不会被跟踪或保存
# 将此设置为 false 将阻止恢复远古残骸
save-replaced-locations: false
==============================
性能设置
==============================
performance:
# 禁用插件时是否恢复远古残骸?
# 警告:如果被替换的方块数量较多,这可能会导致显著的卡顿
# 如果为 false,当插件禁用时,远古残骸将保持为下界岩
restore-debris-on-disable: false
# 配置文件更改时是否恢复远古残骸?
# 警告:如果被替换的方块数量较多,这可能会导致显著的卡顿
# 如果为 false,当配置文件更改时,远古残骸将保持为下界岩
restore-debris-on-config-change: false
# 每个区块最多替换的远古残骸数量,以防止卡顿
# 较高的值可能会导致更多卡顿,但会替换更多的远古残骸
# 较低的值可以减少卡顿,但可能会留下一些未被替换的远古残骸
# 设置为 -1 以完全移除限制(不建议用于性能考虑)
max-replacements-per-chunk: 50
==============================
高级设置
==============================
advanced:
# 每个世界存储的远古残骸位置的最大数量
# 较高的值会使用更多内存,但允许跟踪更多被替换的方块
# 较低的值会使用较少内存,但可能会限制可以恢复的方块数量
# 设置为 -1 以完全移除限制(不建议用于大型世界)
max-locations-per-world: 10000
# 命令执行之间的冷却时间(秒)
# 此选项可防止命令滥用和潜在的性能问题
command-cooldown-seconds: 1
# 是否在控制台中记录远古残骸的替换操作?
# 如果为 true,每次替换远古残骸时都会记录一条消息
# 如果为 false,仅记录摘要消息
log-debris-replacements: true
# 是否在库存中记录下界合金物品的移除操作?
# 如果为 true,每次移除下界合金物品时都会记录一条消息
# 如果为 false,仅记录摘要消息
log-inventory-removals: true
# 是否忽略处于创造模式或旁观者模式的玩家?
# 如果为 true,处于创造模式或旁观者模式的玩家不会受到插件影响
# 如果为 false,无论游戏模式如何,所有玩家都会受到影响
ignore-creative-spectator: true
# 是否向玩家发送通知消息?
# 如果为 true,当插件阻止玩家的操作时,玩家会收到通知
# 如果为 false,玩家仅在遭受破坏性操作(如物品移除等)时才会收到通知
notify-players: true
==============================
检测设置
==============================
detection:
# 是否使用名称匹配来检测下界合金物品?
# 如果为 true,任何名称中包含“NETHERITE”的物品都将被视为下界合金物品
# 如果为 false,则只有下方列表中的物品被视为下界合金物品
use-name-matching: true
# 被视为下界合金物品的物品列表
# 这些是 Bukkit Material 枚举名称
# 如有需要,您可以在此添加自定义物品
# 物品名称遵循 Bukkit Material 枚举的格式
items:
- NETHERITE_SWORD
- NETHERITE_PICKAXE
- NETHERITE_AXE
- NETHERITE_SHOVEL
- NETHERITE_HOE
# - NETHERITE_SPEAR # 见下文
- NETHERITE_HELMET
- NETHERITE_CHESTPLATE
- NETHERITE_LEGGINGS
- NETHERITE_BOOTS
# - NETHERITE_HORSE_ARMOR # 根据版本取消注释,通常由模式匹配覆盖
# - NETHERITE_NAUTILUS_ARMOR # 同上
- NETHERITE_BLOCK
- NETHERITE_INGOT
- NETHERITE_SCRAP
- NETHERITE_UPGRADE_SMITHING_TEMPLATE
- ANCIENT_DEBRIS
==============================
计时设置
==============================
timing:
# 每次库存检查之间的延迟(秒)
# 较高的值会降低服务器负载,但可能会允许玩家更长时间地持有下界合金物品
delay: 1
# 将此数字乘以延迟以获得实际的 tick 延迟
# 20 ticks = 1 秒,因此默认值为检查间隔 1 秒
# 这适用于 Bukkit 和 Folia 调度器
multiplier: 20
## 命令
该插件提供了全面的命令,可在游戏内管理所有设置,无需编辑配置文件:
- `/antinetherite reload` - 重新加载配置
- `/antinetherite restore-debris [world]` - 恢复所有被替换的远古残骸(可选地指定特定世界)
- `/antinetherite restore-feedback <on|off>` - 切换恢复进度反馈(仅玩家)
- `/antinetherite debris-info` - 显示已存储的远古残骸位置信息
- `/antinetherite get <setting>` - 获取配置值
- `/antinetherite set <setting> <value>` - 设置配置值
配置文件中的每个设置都可以通过这些命令进行调整。可用的设置按类别组织:
**全局设置:**
- `global.enable-destructive-actions` - 启用/禁用破坏性操作,如移除物品和过滤生成的战利品 (true/false)
**库存设置:**
- `inventory.clear` - 启用/禁用清除库存中的下界合金 (true/false)
- `inventory.cancel-move` - 启用/禁用阻止下界合金物品的库存移动 (true/false)
- `inventory.cancel-container-transfer` - 启用/禁用阻止下界合金物品的自动化漏斗/容器传输 (true/false, 默认禁用,因为会影响性能)
**交互设置:**
- `interaction.cancel-craft` - 启用/禁用取消下界合金合成 (true/false)
- `interaction.cancel-equip` - 启用/禁用阻止下界合金盔甲装备 (true/false)
- `interaction.cancel-attack` - 启用/禁用阻止使用下界合金武器攻击 (true/false)
**物品处理设置:**
- `item-handling.cancel-pickup` - 启用/禁用阻止拾取下界合金物品 (true/false)
- `item-handling.remove-dropped` - 启用/禁用移除掉落的下界合金物品 (true/false)
**战利品表设置:**
- `loot-tables.remove-blocked-items` - 启用/禁用从生成的战利品表中移除被屏蔽的下界合金物品;仅在 `global.enable-destructive-actions` 为 true 时有效 (true/false)
- `loot-tables.inherit-detection-items` - 启用/禁用继承主 `detection.items` 列表以进行战利品表过滤 (true/false)
- `loot-tables.use-name-matching` - 启用/禁用战利品表过滤的名称匹配,独立于 `inherit-detection-items` 运行 (true/false)
**远古残骸设置:**
- `ancient-debris.replace-when-mined` - 启用/禁用在挖掘时将远古残骸替换为下界岩 (true/false)
- `ancient-debris.replace-on-chunk-load` - 启用/禁用在区块加载时将远古残骸替换为下界岩 (true/false)
- `ancient-debris.only-replace-generated-chunks` - 启用/禁用仅在生成的区块中替换远古残骸 (true/false)
- `ancient-debris.ensure-chunks-loaded` - 启用/禁用在替换远古残骸时确保区块已加载 (true/false)
- `ancient-debris.save-replaced-locations` - 启用/禁用保存被替换的远古残骸位置 (true/false)
**性能设置:**
- `performance.restore-debris-on-disable` - 启用/禁用在插件禁用时恢复远古残骸 (true/false)
- `performance.restore-debris-on-config-change` - 启用/禁用在配置更改时恢复远古残骸 (true/false)
- `performance.max-replacements-per-chunk` - 设置每个区块的最大远古残骸替换数量 (整数, -1 表示无限制)
**高级设置:**
- `advanced.max-locations-per-world` - 设置每个世界存储的远古残骸位置的最大数量 (整数, -1 表示无限制)
- `advanced.command-cooldown-seconds` - 设置命令执行之间的冷却时间 (整数)
- `advanced.log-debris-replacements` - 启用/禁用记录远古残骸替换 (true/false)
- `advanced.log-inventory-removals` - 启用/禁用记录下界合金物品移除 (true/false)
- `advanced.ignore-creative-spectator` - 启用/禁用忽略创造模式或旁观者模式的玩家 (true/false)
- `advanced.notify-players` - 启用/禁用在玩家行动被阻止时通知玩家 (true/false)
**检测设置:**
- `detection.use-name-matching` - 启用/禁用基于名称的下界合金物品检测 (true/false)
**计时设置:**
- `timing.delay` - 设置库存检查之间的延迟(秒)
- `timing.multiplier` - 设置刻乘数 (20 = 1 秒)
用于管理下界合金物品列表的特殊命令:
- `/antinetherite get detection.items` - 列出所有被视为下界合金的物品
- `/antinetherite set detection.items add <item>` - 向地下合金物品列表中添加一个物品
- `/antinetherite set detection.items remove <item>` - 从下界合金物品列表中移除一个物品
- `/antinetherite get loot-tables.items` - 列出从生成的战利品表中移除的物品
- `/antinetherite set loot-tables.items add <item>` - 向战利品表黑名单中添加一个物品
- `/antinetherite set loot-tables.items remove <item>` - 从战利品表黑名单中移除一个物品
- `/antinetherite get loot-tables.preserve-items` - 列出在生成的战利品表中保留的物品
- `/antinetherite set loot-tables.preserve-items add <item>` - 向战利品表保留列表中添加一个物品
- `/antinetherite set loot-tables.preserve-items remove <item>` - 从战利品表保留列表中移除一个物品
## 权限
- `antinetherite.manage` - 允许使用 `/antinetherite` 命令(默认:op)
- `antinetherite.bypass` - 允许玩家绕过下界合金物品移除(默认:op)
## 用法
1. 将构建好的 JAR 文件放入服务器的 `plugins` 文件夹。
2. 启动或重启 Minecraft 服务器。
3. 如有需要,在 `plugins/AntiNetherite/config.yml` 中配置插件设置。
4. 使用游戏内命令根据需要调整设置。
## 下界合金物品检测
该插件提供了两种完全可配置的方式来检测下界合金物品:
1. **名称匹配**:任何类型名称中包含“NETHERITE”的物品都将被视为下界合金物品。这是默认行为。
2. **自定义列表**:你可以定义一个自定义物品列表,将这些物品视为下界合金物品。如果你希望添加自定义物品或仅阻止特定的下界合金物品,这将非常有用。
你可以通过 `detection.use-name-matching` 设置在两种方法之间切换。如果设置为 `false`,则只有自定义列表中的物品会被视为下界合金物品。
## 下界合金物品保护
插件可以通过多种方式防止玩家使用下界合金物品:
1. **破坏性与非破坏性模式**:全局设置 `enable-destructive-actions` 控制插件如何处理下界合金物品:
- **非破坏性模式(默认,`enable-destructive-actions: false`)**:尽可能取消相关事件,但不会销毁物品和生成的战利品,在防止使用下界合金的同时保持对玩家的友好性
- **破坏性模式(`enable-destructive-actions: true`)**:从玩家库存中移除物品,丢弃时删除,并从生成的战利品表中过滤掉,以实施更严格的管控
要切换模式,请使用命令:`/antinetherite set global.enable-destructive-actions <true|false>` 或直接编辑配置文件
2. **库存保护**:插件可以防止玩家在库存中持有下界合金物品:
- 定期清除玩家库存中的物品
- 阻止在库存中移动下界合金物品
- 阻止自动化容器(漏斗)传输下界合金物品(默认禁用,因为会影响性能)
- 防止从地面拾取下界合金物品
- 移除或阻止丢弃下界合金物品
3. **战利品表过滤**:插件可以在战利品放置之前,从生成的战利品表中移除被屏蔽的下界合金物品。默认情况下,战利品过滤继承主检测列表,使用名称匹配来捕获任何包含“NETHERITE”材质的物品(包括来自新版本游戏的物品),并保留 `ANCIENT_DEBRIS`、`NETHERITE_SCRAP` 和 `NETHERITE_INGOT`,以便服务器可以在不抹除资源类战利品的情况下阻止生成装备。战利品表的名称匹配由 `loot-tables.use-name-matching` 独立控制。
4. **使用阻止**:插件可以防止玩家使用下界合金物品:
- 取消下界合金物品的合成
- 阻止装备下界合金盔甲
- 阻止使用下界合金武器进行攻击
所有这些功能都可以单独配置,以创建适合你服务器需求的精确保护系统。
## 远古残骸替换
插件可以通过两种方式防止玩家获得远古残骸,两者均可独立配置:
1. **挖掘阻止**:当玩家开始挖掘远古残骸时,它会立即被基岩取代,且不提供任何掉落物。
2. **生成阻止**:当新区块生成时,这些区块中的任何远古残骸都会自动被基岩取代。
这些功能可以使用 `ancient-debris.replace-when-mined` 和 `ancient-debris.replace-on-chunk-load` 设置独立切换。
### 可逆性
插件会记录所有已被替换为基岩的远古残骸。默认情况下,当插件禁用或配置更改时,已替换的远古残骸**不会**自动恢复。此行为可以通过性能设置进行控制:
- `performance.restore-debris-on-disable`:控制是否在插件禁用时恢复远古残骸
- `performance.restore-debris-on-config-change`:控制是否在配置更改时恢复远古残骸
你也可以使用 `/antinetherite restore-debris` 命令手动恢复所有已替换的远古残骸。
### 恢复进度报告
当使用 `/antinetherite restore-debris` 命令恢复远古残骸时,插件会通过混合报告系统提供全面的进度反馈:
1. **即时调度摘要**:当你执行恢复命令时,你会立即收到一个摘要,显示:
- 计划恢复的区块数量
- 需要恢复的远古残骸位置总数
- 目标世界(如果正在恢复特定世界)
2. **定期进度更新**:在恢复过程中,你会收到基于以下内容的自动进度更新:
- **基于时间的更新**:每 60 秒一次,显示已用时间
- **基于百分比的更新**:在固定的百分比间隔处
- 对于大型恢复(≥1000 个位置):每 1% 更新一次
- 对于较小规模的恢复(<1000 个位置):每 10% 更新一次
每次更新显示:
- 当前进度(已完成/总位置数)
- 完成百分比
- 人类可读格式的已用时间
3. **最终完成消息**:当恢复完成时,你会收到一个最终摘要,包含:
- 恢复的远古残骸方块总数
- 恢复所需的总时间
4. **反馈控制**:玩家可以使用以下方式控制是否接收这些进度更新:
- `/antinetherite restore-feedback on` - 启用恢复进度更新(默认)
- `/antinetherite restore-feedback off` - 禁用恢复进度更新
注意:控制台用户始终会收到更新,且无法选择退出。
这种混合方法确保你在长时间运行的恢复操作中保持知情,而不会被过多的消息淹没。
### 性能考量
远古残骸替换系统包含多项性能优化措施:
- **可配置的还原**:默认情况下,在插件禁用或配置更改时不会还原远古残骸,以防止潜在的卡顿
- **替换限制**:`performance.max-replacements-per-chunk` 设置限制了每个区块可以替换的方块数量,以防止卡顿
- **内存管理**:`advanced.max-locations-per-world` 设置控制每个世界跟踪的已替换方块数量
- **日志控制**:`advanced.log-debris-replacements` 和 `advanced.log-inventory-removals` 设置允许你减少控制台刷屏
- **选择性处理**:仅处理下界维度中自然生成远古残骸的区块
- **区块生成检查**:可配置为仅处理已经生成的区块
- **区块加载控制**:可配置为确保在替换或还原远古残骸时区块处于加载状态
**容器转移保护**:自动阻止容器转移的功能(`inventory.cancel-container-transfer`)默认禁用,因为可能会对性能产生影响。此功能会监控所有漏斗和容器物品移动,这在拥有大量自动化系统的服务器上可能会增加显著开销。仅在确实需要防止玩家利用漏斗绕过库存限制时才启用此功能。
### 安全措施
远古残骸替换系统包含多种安全措施:
- **线程安全**:使用线程安全的集合来防止并发修改问题
- **错误处理**:捕获并记录异常,而不会导致插件崩溃
- **异步处理**:异步执行还原操作,以防止服务器卡顿
- **冷却系统**:通过可配置的冷却时间来防止命令滥用
- **特定世界还原**:允许在特定世界中还原远古残骸
- **存储限制**:通过限制存储的位置数量来防止过度占用内存
- **持久化存储**:将替换的位置保存到磁盘,以便在服务器重启后恢复
## 兼容性
- 适用于 Bukkit/Spigot/Paper 服务器
- 完全兼容 Folia 1.21.4,支持区域感知调度器
- 支持热重载
## 贡献
有关构建插件和参与开发的信息,请参阅 [CONTRIBUTING.md](https://github.com/modpotato-plugins/antinetherite/blob/main/CONTRIBUTING.md)。
AntiNetherite Plugin
AntiNetherite is a highly configurable Minecraft plugin designed to remove Netherite items from player inventories and prevent their crafting, equipping, and attacking with Netherite items. Every aspect of the plugin can be enabled, disabled, or fine-tuned to suit your server's needs.
The plugin operates in non-destructive mode by default (enable-destructive-actions: false). In non-destructive mode, it will only prevent the use of Netherite items without destroying them, making it player-friendly while still enforcing server rules. You can switch to destructive mode by setting enable-destructive-actions: true, which will remove items from inventories, delete dropped items, and filter blocked items from generated loot tables.
Features
- Fully Configurable Protection System - Every feature can be individually enabled or disabled
- Non-Destructive Mode Available - Choose between removing items or just preventing their use
- Periodically removes Netherite items from player inventories
- Cancels the crafting of Netherite items
- Prevents equipping Netherite armor
- Prevents attacking with Netherite weapons
- Prevents picking up Netherite items
- Removes dropped Netherite items
- Prevents moving Netherite items in inventories
- Blocks automated container (hopper) transfers of Netherite items (configurable, disabled by default due to performance impact)
- Filters blocked Netherite items out of generated loot tables while preserving configured resource drops
- Replaces Ancient Debris with Netherrack when mined or generated
- Performance-Optimized - Control whether replaced Ancient Debris is restored on plugin disable
- Fine-Grained Control - Advanced settings for memory usage, logging, and more
- Customizable Netherite item detection
- Creative/Spectator Mode Exclusion - Optionally ignore players in creative or spectator mode
- Configurable Player Notifications - Control whether players are notified of blocked actions
- Fully compatible with Folia 1.21.4 using region-aware schedulers
- In-game commands to manage all settings
- Hot reload support for configuration changes without server restart
Configuration
Every aspect of the plugin's behavior can be customized in the config.yml file. All features can be individually enabled or disabled, allowing you to create the exact protection system your server needs:
# Main plugin settings
anti-netherite:
# ==============================
# GLOBAL SETTINGS
# ==============================
global:
# Should we enable destructive actions?
# If true, the plugin will delete/remove items when appropriate
# If false, the plugin will only cancel events without destroying items
# This affects item drops, inventory clearing, loot table filtering, and other destructive operations
enable-destructive-actions: false
# ==============================
# INVENTORY PROTECTION SETTINGS
# ==============================
inventory:
# Should we clear netherite in the inventory of players?
# This feature is compatible with Folia using region-aware schedulers
clear: false
# Should we cancel moving netherite items in inventories?
# This prevents players from moving netherite items in their inventory
cancel-move: true
# Should we cancel automated container transfers (hoppers, hopper minecarts, etc.)
# of netherite items between inventories?
# This blocks bypasses where players pipe netherite into containers
# WARNING: This can impact server performance with many hoppers/containers
# Only enable if you need this additional protection layer
cancel-container-transfer: false
# ==============================
# ITEM INTERACTION SETTINGS
# ==============================
interaction:
# Should we cancel crafting of netherite items?
# This prevents players from crafting any items containing netherite
cancel-craft: true
# Should we cancel equipping of netherite items?
# This prevents players from equipping netherite armor
cancel-equip: true
# Should we cancel attacking with netherite items?
# This prevents players from attacking with netherite weapons
cancel-attack: true
# ==============================
# ITEM PICKUP/DROP SETTINGS
# ==============================
item-handling:
# Should we cancel picking up netherite items?
# This prevents players from picking up netherite items from the ground
cancel-pickup: true
# Should we remove netherite items when dropped?
# This removes netherite items when players drop them
remove-dropped: false
# ==============================
# LOOT TABLE SETTINGS
# ==============================
loot-tables:
# Should we remove blocked Netherite items from generated loot tables?
# This filters the generated loot before it is placed into chests, entities, etc.
# It does not remove unrelated loot from the same table
# Requires global.enable-destructive-actions to be true
remove-blocked-items: true
# Should loot table filtering inherit the main detection.items block list?
# If true, loot-tables.items is added on top of detection.items
# If false, only loot-tables.items is used for loot table filtering
inherit-detection-items: true
# Should loot table filtering use name matching to detect blocked items?
# If true, any material whose name contains "NETHERITE" will be blocked from loot tables
# This operates independently of inherit-detection-items — it always runs a Material scan
# for loot tables when enabled, regardless of whether detection items are inherited
use-name-matching: true
# Additional items to remove from generated loot tables
# These are Bukkit Material enum names
# When inherit-detection-items is false, this becomes the complete loot table block list
# Vanilla Minecraft does not currently include Netherite wolf armor; add
# NETHERITE_WOLF_ARMOR here if your server software or custom content provides it
items:
- NETHERITE_SWORD
- NETHERITE_PICKAXE
- NETHERITE_AXE
- NETHERITE_SHOVEL
- NETHERITE_HOE
# - NETHERITE_SPEAR # uncomment depending on version, should be covered by pattern matching
- NETHERITE_HELMET
- NETHERITE_CHESTPLATE
- NETHERITE_LEGGINGS
- NETHERITE_BOOTS
# - NETHERITE_HORSE_ARMOR # same as above
# - NETHERITE_NAUTILUS_ARMOR # same as above
- NETHERITE_BLOCK
- NETHERITE_UPGRADE_SMITHING_TEMPLATE
# Items that should never be removed by loot table filtering
# This lets servers block generated Netherite gear while still allowing
# resource-style loot such as Ancient Debris, scraps, and ingots
preserve-items:
- ANCIENT_DEBRIS
- NETHERITE_SCRAP
- NETHERITE_INGOT
# ==============================
# ANCIENT DEBRIS SETTINGS
# ==============================
ancient-debris:
# Should we replace Ancient Debris with Netherrack when mined?
# This prevents players from obtaining Ancient Debris
replace-when-mined: true
# Should we replace Ancient Debris with Netherrack when chunks are loaded?
# This prevents Ancient Debris from generating in the world
# THIS MAY CAUSE LAG ON FIRST LOAD
replace-on-chunk-load: false
# Should we only replace Ancient Debris in chunks that are already generated?
# If true, only chunks that have been generated will be processed
# If false, all chunks will be processed regardless of generation status
only-replace-generated-chunks: true
# Should we ensure chunks are loaded when trying to replace Ancient Debris?
# If true, chunks will be loaded if they are not already loaded
# If false, only already loaded chunks will be processed
ensure-chunks-loaded: false
# Should we save the locations of replaced Ancient Debris?
# If true, the plugin will track and save replaced Ancient Debris locations
# If false, Ancient Debris will be replaced but not tracked or saved
# Setting this to false will prevent restoration of Ancient Debris
save-replaced-locations: false
# ==============================
# PERFORMANCE SETTINGS
# ==============================
performance:
# Should we restore Ancient Debris when the plugin is disabled?
# WARNING: This can cause significant lag if there are many replaced blocks
# If false, Ancient Debris will remain as Netherrack when the plugin is disabled
restore-debris-on-disable: false
# Should we restore Ancient Debris when the configuration changes?
# WARNING: This can cause significant lag if there are many replaced blocks
# If false, Ancient Debris will remain as Netherrack when the configuration changes
restore-debris-on-config-change: false
# Maximum number of Ancient Debris to replace per chunk to prevent lag
# Higher values may cause more lag but will replace more Ancient Debris
# Lower values will reduce lag but may leave some Ancient Debris unreplaced
# Set to -1 to remove the limit entirely (not recommended for performance)
max-replacements-per-chunk: 50
# ==============================
# ADVANCED SETTINGS
# ==============================
advanced:
# Maximum number of Ancient Debris locations to store per world
# Higher values use more memory but allow tracking more replaced blocks
# Lower values use less memory but may limit the number of blocks that can be restored
# Set to -1 to remove the limit entirely (not recommended for large worlds)
max-locations-per-world: 10000
# Cooldown in seconds between command executions
# This prevents command spam and potential performance issues
command-cooldown-seconds: 1
# Should we log Ancient Debris replacements to the console?
# If true, a message will be logged each time Ancient Debris is replaced
# If false, only summary messages will be logged
log-debris-replacements: true
# Should we log Netherite item removals from inventories?
# If true, a message will be logged each time Netherite items are removed
# If false, only summary messages will be logged
log-inventory-removals: true
# Should we ignore players in creative or spectator mode?
# If true, players in creative or spectator mode will not be affected by the plugin
# If false, all players will be affected regardless of game mode
ignore-creative-spectator: true
# Should we send notification messages to players?
# If true, players will be notified when the plugin blocks their actions
# If false, players will only be notified for destructive actions (item removal, etc.)
notify-players: true
# ==============================
# DETECTION SETTINGS
# ==============================
detection:
# Should we use name matching to detect Netherite items?
# If true, any item with a name containing "NETHERITE" will be considered a Netherite item
# If false, only items in the list below will be considered Netherite items
use-name-matching: true
# List of items to consider as Netherite items
# These are Bukkit Material enum names
# You can add custom items here if needed
# The item names follow the format of the Bukkit Material enum
items:
- NETHERITE_SWORD
- NETHERITE_PICKAXE
- NETHERITE_AXE
- NETHERITE_SHOVEL
- NETHERITE_HOE
# - NETHERITE_SPEAR # see below
- NETHERITE_HELMET
- NETHERITE_CHESTPLATE
- NETHERITE_LEGGINGS
- NETHERITE_BOOTS
# - NETHERITE_HORSE_ARMOR # uncomment depending on version, should be covered by pattern matching
# - NETHERITE_NAUTILUS_ARMOR # same as above
- NETHERITE_BLOCK
- NETHERITE_INGOT
- NETHERITE_SCRAP
- NETHERITE_UPGRADE_SMITHING_TEMPLATE
- ANCIENT_DEBRIS
# ==============================
# TIMING SETTINGS
# ==============================
timing:
# Delay in seconds between each inventory check
# Higher values reduce server load but may allow players to keep netherite items longer
delay: 1
# Multiply the delay by this number to get the actual delay in ticks
# 20 ticks = 1 second, so the default is 1 second between checks
# This is used for both Bukkit and Folia schedulers
multiplier: 20
Commands
The plugin provides comprehensive commands to manage all settings in-game without editing configuration files:
/antinetherite reload - Reload the configuration
/antinetherite restore-debris [world] - Restore all replaced Ancient Debris (optionally in a specific world)
/antinetherite restore-feedback <on|off> - Toggle restoration progress feedback (players only)
/antinetherite debris-info - Show information about stored Ancient Debris locations
/antinetherite get <setting> - Get a configuration value
/antinetherite set <setting> <value> - Set a configuration value
Every setting in the configuration file can be adjusted through these commands. Available settings are organized by category:
Global settings:
global.enable-destructive-actions - Enable/disable destructive actions like removing items and filtering generated loot (true/false)
Inventory settings:
inventory.clear - Enable/disable clearing Netherite from inventories (true/false)
inventory.cancel-move - Enable/disable preventing inventory movement of Netherite items (true/false)
inventory.cancel-container-transfer - Enable/disable blocking automated hopper/container transfers of Netherite items (true/false, disabled by default due to performance impact)
Interaction settings:
interaction.cancel-craft - Enable/disable canceling Netherite crafting (true/false)
interaction.cancel-equip - Enable/disable preventing Netherite armor equipping (true/false)
interaction.cancel-attack - Enable/disable preventing attacks with Netherite weapons (true/false)
Item handling settings:
item-handling.cancel-pickup - Enable/disable preventing picking up Netherite items (true/false)
item-handling.remove-dropped - Enable/disable removing dropped Netherite items (true/false)
Loot table settings:
loot-tables.remove-blocked-items - Enable/disable removing blocked Netherite items from generated loot tables; only effective when global.enable-destructive-actions is true (true/false)
loot-tables.inherit-detection-items - Enable/disable inheriting the main detection.items list for loot table filtering (true/false)
loot-tables.use-name-matching - Enable/disable name matching for loot table filtering, operating independently of inherit-detection-items (true/false)
Ancient debris settings:
ancient-debris.replace-when-mined - Enable/disable replacing Ancient Debris with Netherrack when mined (true/false)
ancient-debris.replace-on-chunk-load - Enable/disable replacing Ancient Debris with Netherrack when chunks are loaded (true/false)
ancient-debris.only-replace-generated-chunks - Enable/disable only replacing Ancient Debris in generated chunks (true/false)
ancient-debris.ensure-chunks-loaded - Enable/disable ensuring chunks are loaded when replacing Ancient Debris (true/false)
ancient-debris.save-replaced-locations - Enable/disable saving locations of replaced Ancient Debris (true/false)
Performance settings:
performance.restore-debris-on-disable - Enable/disable restoring Ancient Debris when the plugin is disabled (true/false)
performance.restore-debris-on-config-change - Enable/disable restoring Ancient Debris when config changes (true/false)
performance.max-replacements-per-chunk - Set the maximum number of Ancient Debris replacements per chunk (integer, -1 for unlimited)
Advanced settings:
advanced.max-locations-per-world - Set the maximum number of Ancient Debris locations to store per world (integer, -1 for unlimited)
advanced.command-cooldown-seconds - Set the cooldown between command executions (integer)
advanced.log-debris-replacements - Enable/disable logging Ancient Debris replacements (true/false)
advanced.log-inventory-removals - Enable/disable logging Netherite item removals (true/false)
advanced.ignore-creative-spectator - Enable/disable ignoring players in creative or spectator mode (true/false)
advanced.notify-players - Enable/disable notifying players when their actions are blocked (true/false)
Detection settings:
detection.use-name-matching - Enable/disable name-based detection of Netherite items (true/false)
Timing settings:
timing.delay - Set the delay between inventory checks (in seconds)
timing.multiplier - Set the tick multiplier (20 = 1 second)
Special commands for managing the Netherite items list:
/antinetherite get detection.items - List all items considered as Netherite items
/antinetherite set detection.items add <item> - Add an item to the Netherite items list
/antinetherite set detection.items remove <item> - Remove an item from the Netherite items list
/antinetherite get loot-tables.items - List items removed from generated loot tables
/antinetherite set loot-tables.items add <item> - Add an item to the loot table block list
/antinetherite set loot-tables.items remove <item> - Remove an item from the loot table block list
/antinetherite get loot-tables.preserve-items - List items preserved in generated loot tables
/antinetherite set loot-tables.preserve-items add <item> - Add an item to the loot table preserve list
/antinetherite set loot-tables.preserve-items remove <item> - Remove an item from the loot table preserve list
Permissions
antinetherite.manage - Allows using the /antinetherite command (default: op)
antinetherite.bypass - Allows players to bypass Netherite item removal (default: op)
Usage
- Place the built JAR file in your server's
plugins folder.
- Start or restart your Minecraft server.
- Configure the plugin settings in
plugins/AntiNetherite/config.yml if needed.
- Use in-game commands to adjust settings as needed.
Netherite Item Detection
The plugin provides two fully configurable ways to detect Netherite items:
- Name Matching: Any item with a type name containing "NETHERITE" will be considered a Netherite item. This is the default behavior.
- Custom List: You can define a custom list of items to be considered as Netherite items. This is useful if you want to add custom items or only block specific Netherite items.
You can toggle between these methods using the detection.use-name-matching setting. If set to false, only items in the custom list will be considered Netherite items.
Netherite Item Protection
The plugin can prevent players from using Netherite items in several ways:
-
Destructive vs. Non-Destructive Mode: The global setting enable-destructive-actions controls how the plugin handles Netherite items:
- Non-destructive mode (default,
enable-destructive-actions: false): Events are cancelled where possible but items and generated loot are not destroyed, making it player-friendly while still preventing Netherite usage
- Destructive mode (
enable-destructive-actions: true): Items are removed from inventories, deleted when dropped, and filtered from generated loot tables for stricter enforcement
To switch modes, use the command: /antinetherite set global.enable-destructive-actions <true|false> or edit the configuration file
-
Inventory Protection: The plugin can prevent players from having Netherite items in their inventory:
- Clear items from player inventories periodically
- Prevent moving Netherite items in inventories
- Block automated container (hopper) transfers of Netherite items (disabled by default due to performance impact)
- Prevent picking up Netherite items from the ground
- Remove or prevent dropping Netherite items
-
Loot Table Filtering: The plugin can remove blocked Netherite items from generated loot tables before the loot is placed. By default, loot filtering inherits the main detection list, uses name matching to catch any material containing "NETHERITE" (including items from newer game versions), and preserves ANCIENT_DEBRIS, NETHERITE_SCRAP, and NETHERITE_INGOT so servers can block generated gear without wiping resource-style loot. Name matching for loot tables is controlled independently by loot-tables.use-name-matching.
-
Usage Prevention: The plugin can prevent players from using Netherite items:
- Cancel crafting of Netherite items
- Prevent equipping Netherite armor
- Prevent attacking with Netherite weapons
All of these features can be individually configured to create the exact protection system your server needs.
Ancient Debris Replacement
The plugin can prevent players from obtaining Ancient Debris in two ways, both independently configurable:
- Mining Prevention: When a player starts to mine Ancient Debris, it is immediately replaced with Netherrack and no drops are given.
- Generation Prevention: When new chunks are generated, any Ancient Debris in those chunks is automatically replaced with Netherrack.
These features can be toggled independently using the ancient-debris.replace-when-mined and ancient-debris.replace-on-chunk-load settings.
Reversibility
The plugin keeps track of all Ancient Debris that has been replaced with Netherrack. By default, replaced Ancient Debris will NOT be automatically restored when the plugin is disabled or when configuration changes. This behavior can be controlled through the performance settings:
performance.restore-debris-on-disable: Controls whether Ancient Debris is restored when the plugin is disabled
performance.restore-debris-on-config-change: Controls whether Ancient Debris is restored when configuration changes
You can also manually restore all replaced Ancient Debris using the /antinetherite restore-debris command.
Restoration Progress Reporting
When restoring Ancient Debris using the /antinetherite restore-debris command, the plugin provides comprehensive progress feedback with a blended reporting system:
-
Immediate Scheduling Summary: When you execute the restore command, you immediately receive a summary showing:
- Number of chunks scheduled for restoration
- Total number of Ancient Debris locations to restore
- Target world (if restoring a specific world)
-
Periodic Progress Updates: During the restoration process, you receive automatic progress updates based on:
- Time-based updates: Every 60 seconds, showing elapsed time
- Percentage-based updates: At regular percentage intervals
- For large restorations (≥1000 locations): Updates every 1%
- For smaller restorations (<1000 locations): Updates every 10%
Each update shows:
- Current progress (completed/total locations)
- Completion percentage
- Elapsed time in a human-readable format
-
Final Completion Message: When restoration completes, you receive a final summary with:
- Total number of Ancient Debris blocks restored
- Total time taken for the restoration
-
Feedback Control: Players can control whether they receive these progress updates using:
/antinetherite restore-feedback on - Enable restoration progress updates (default)
/antinetherite restore-feedback off - Disable restoration progress updates
Note: Console users always receive updates and cannot opt out.
This blended approach ensures you stay informed about long-running restoration operations without being overwhelmed by excessive messages.
Performance Considerations
The Ancient Debris replacement system includes several performance optimizations:
- Configurable Restoration: By default, Ancient Debris is NOT restored when the plugin is disabled or when configuration changes, preventing potential lag spikes
- Replacement Limits: The
performance.max-replacements-per-chunk setting limits how many blocks can be replaced per chunk to prevent lag
- Memory Management: The
advanced.max-locations-per-world setting controls how many replaced blocks are tracked per world
- Logging Control: The
advanced.log-debris-replacements and advanced.log-inventory-removals settings allow you to reduce console spam
- Selective Processing: Only processes chunks in the Nether dimension where Ancient Debris naturally generates
- Chunk Generation Checking: Can be configured to only process chunks that have already been generated
- Chunk Loading Control: Can be configured to ensure chunks are loaded when replacing or restoring Ancient Debris
Container Transfer Protection: The automated container transfer blocking feature (inventory.cancel-container-transfer) is disabled by default due to potential performance impact. This feature monitors all hopper and container item movements, which can add significant overhead on servers with many automated systems. Only enable this feature if you specifically need protection against players using hoppers to bypass inventory restrictions.
Safeguards
The Ancient Debris replacement system includes several safeguards:
- Thread Safety: Uses thread-safe collections to prevent concurrent modification issues
- Error Handling: Catches and logs exceptions without crashing the plugin
- Async Processing: Performs restoration operations asynchronously to prevent server lag
- Cooldown System: Prevents command spam with a configurable cooldown period
- World-Specific Restoration: Allows restoring Ancient Debris in specific worlds
- Storage Limits: Prevents excessive memory usage by limiting the number of stored locations
- Persistent Storage: Saves replaced locations to disk for recovery after server restarts
Compatibility
- Works with Bukkit/Spigot/Paper servers
- Fully compatible with Folia 1.21.4 using region-aware schedulers
- Supports hot reloads
Contributing
For information on building the plugin and contributing to development, please see CONTRIBUTING.md.
评论 0
登录后参与评分
还没有评论,来抢沙发吧