DisabledItem
你拾取到的任何物品都将被禁用。 当一件物品进入玩家的背包时,它会被永久标记为已禁用状态——捡起一把战锤,这把战锤即被禁用。在管理员恢复之前,禁用的物品将无法使用、移动、丢弃或用于合成。
为什么选择它
- 零配置 — 放入罐子,重启服务器,完成。无需维护每物品的列表,无需数据库,无需外部插件
- 全覆盖 — 禁用标记存储在物品本身,因此无论物品如何获取、转移、附魔或重命名,它们都会保持禁用状态
- 无漏洞 — 所有交互路径均被阻止:使用、消耗、丢弃、交换、背包点击、拖拽、漏斗、合成、铁砧、砂轮和锻造台
- 全平台运行 — 原生支持 Folia(具备区域感知调度),同时完全兼容 Paper/Purpur;没有其他插件能开箱即用同时支持这两者
- 轻量级 — 仅需少量事件监听器和一个小型配置文件,零依赖
- 对管理员友好 — 只需一条命令即可标记或恢复手中的任意物品,并可在不重启服务器的情况下重载配置
功能
- 拾取即禁用 — 拾取任何物品(战锤、剑、鞘翅、方块等)后,它将立即被禁用
- 全面拦截 — 禁用物品无法右键/使用、消耗、丢弃、双手切换、在背包中点击或拖拽、被漏斗移动,也无法用于合成、铁砧、砂轮或锻造台
- 手动控制 —
/disableditem 禁用你手中的物品,/disableditem undo 恢复它
- 可选的背包清理 — 自动从玩家背包中移除禁用物品 (
remove-disabled-items: true)
- Folia + Paper 支持 — 可在 Paper、Purpur、Folia 及其所有分支上运行(使用区域感知调度,Folia 上不依赖 Bukkit 调度器)
- 完全可配置 —
config.yml 中可配置每种方块类型、消息和行为
工作原理
当玩家拾取物品时,插件会在该物品堆栈上写入持久化数据标记。从此,该物品被视为已禁用:所有与其交互的行为都会被事件监听器取消,并且可选的定期扫描会将禁用物品从背包中清除。
标记存储在物品本身(PersistentDataContainer)上,因此即使物品被转移、附魔或重命名,它们仍会保持禁用状态。
命令
| 命令 |
描述 |
权限 |
/disableditem |
禁用主手中当前持有的物品 |
disableditem.use |
/disableditem mark |
同上(显式形式) |
disableditem.use |
/disableditem undo |
移除主手中物品的禁用标记 |
disableditem.use |
/disableditem reload |
在不重启服务器的情况下重载 config.yml |
disableditem.reload |
所有命令均支持 Tab 补全,并拥有别名 /di 和 /disabled-item。
示例:
/disableditem — 手持战锤时执行此命令,将禁用该战锤
/disableditem undo — 手持同一把战锤时执行此命令,使其恢复可用
/disableditem reload — 立即应用配置更改
权限
| 权限 |
默认值 |
描述 |
disableditem.use |
op |
标记和解除物品的禁用状态 |
disableditem.reload |
op |
重载配置文件 |
授予 disableditem.use 给希望能够禁用和恢复物品的员工;将 disableditem.reload 保留给管理员。
配置
# DisabledItem 插件配置
enabled: true
# 当玩家拾取 ANY 物品时,它将立即被标记为禁用
disable-on-pickup: true
# 对禁用物品要阻止的操作
block:
inventory-click: true # 无法在背包中点击或Shift-点击
drag: true # 无法在背包中拖拽(或在上方拖拽)
use: true # 无法右键点击 / 消耗
drop: true # 无法丢弃
swap: true # 无法在主手和副手之间交换
hopper: true # 漏斗无法移动或吸取它
crafting: true # 无法用它进行合成、重命名(铁砧)、研磨或锻造
# 自动从玩家背包中 REMOVE 禁用物品
# (默认:false - 禁用物品保留在背包中但不可用)
remove-disabled-items: false
# 消息 ({item} = 物品名称,支持 & 颜色代码)
disable-message: "&c你拾取了 {item}!它现在已被禁用。"
block-message: "&c此物品已被禁用!"
# 背包扫描的运行频率(20 tick = 1秒)
scan-interval-ticks: 100
兼容性
- Minecraft 1.21.x(基于 Paper API 1.21.11 构建)
- Paper、Purpur、Folia 及其他 Paper 分支
- Java 21+
安装
- 下载最新的
DisabledItem-x.y.z.jar
- 将其放入服务器的
plugins 文件夹
- 重启服务器
- 完成 — 现在拾取物品将禁用它们
从源代码构建
mvn clean package
Jar 包输出至 target/DisabledItem-1.1.0.jar。
许可证
MIT — 你可以随意使用它。
DisabledItem
Any item you pick up becomes disabled. The moment an item enters a player's inventory, it is permanently marked as disabled — pick up a mace and that mace is disabled. Disabled items can no longer be used, moved, dropped or crafted with, until an admin restores them.
Why you should choose it
- Zero setup — drop the jar in, restart, done. No per-item lists to maintain, no databases, no external plugins
- Covers everything — the disabled mark lives on the item itself, so no matter how items are obtained, transferred, enchanted or renamed, they stay disabled
- No exploits — every interaction path is blocked: use, consume, drop, swap, inventory clicks, drags, hoppers, crafting, anvil, grindstone and smithing table
- Runs everywhere — native Folia support with region-aware scheduling, plus full Paper/Purpur compatibility; no other plugin does both out of the box
- Lightweight — a handful of event listeners and one small config, zero dependencies
- Admin-friendly — mark or restore any item in your hand with a single command, and reload the config without restarting
Features
- Disable on pickup — pick up any item (mace, sword, elytra, blocks, anything) and it is instantly disabled
- Full blocking — disabled items cannot be right-clicked/used, consumed, dropped, swapped between hands, clicked or dragged in inventories, moved by hoppers, or used in crafting, anvil, grindstone or smithing table
- Manual control —
/disableditem disables the item in your hand, /disableditem undo restores it
- Optional inventory sweep — automatically removes disabled items from player inventories (
remove-disabled-items: true)
- Folia + Paper support — runs on Paper, Purpur, Folia and all forks (uses region-aware scheduling, no Bukkit scheduler on Folia)
- Fully configurable — every block type, message and behavior is configurable in
config.yml
How it works
When a player picks up an item, the plugin writes a persistent data marker onto that item stack. From then on, the item is treated as disabled: every interaction with it is cancelled by event listeners, and an optional periodic scan sweeps disabled items out of inventories.
Markers are stored on the item itself (PersistentDataContainer), so disabled items stay disabled even if they are transferred, enchanted or renamed.
Commands
| Command |
Description |
Permission |
/disableditem |
Disables the item currently in your main hand |
disableditem.use |
/disableditem mark |
Same as above (explicit form) |
disableditem.use |
/disableditem undo |
Removes the disabled mark from the item in your main hand |
disableditem.use |
/disableditem reload |
Reloads config.yml without restarting the server |
disableditem.reload |
All commands have tab-completion and the aliases /di and /disabled-item.
Examples:
/disableditem — while holding a mace, this disables the mace
/disableditem undo — while holding the same mace, this makes it usable again
/disableditem reload — apply config changes immediately
Permissions
| Permission |
Default |
Description |
disableditem.use |
op |
Mark and unmark items as disabled |
disableditem.reload |
op |
Reload the config |
Grant disableditem.use to staff you want to be able to disable and restore items; keep disableditem.reload for admins only.
Configuration
# DisabledItem plugin config
enabled: true
# When a player picks up ANY item, it is instantly marked as disabled
disable-on-pickup: true
# What to block for disabled items
block:
inventory-click: true # Cannot click or shift-click it in inventories
drag: true # Cannot drag it (or over it) in inventories
use: true # Cannot right-click / consume it
drop: true # Cannot drop it
swap: true # Cannot swap it between main hand and off hand
hopper: true # Hoppers cannot move or vacuum it
crafting: true # Cannot craft, rename (anvil), grind or smith with it
# Automatically REMOVE disabled items from player inventories
# (default: false - disabled items stay in the inventory but are unusable)
remove-disabled-items: false
# Messages ({item} = item name, supports & color codes)
disable-message: "&cYou picked up {item}! It is now disabled."
block-message: "&cThis item is disabled!"
# How often the inventory scan runs (20 ticks = 1 second)
scan-interval-ticks: 100
Compatibility
- Minecraft 1.21.x (built against Paper API 1.21.11)
- Paper, Purpur, Folia and other Paper forks
- Java 21+
Installation
- Download the latest
DisabledItem-x.y.z.jar
- Place it in your server's
plugins folder
- Restart the server
- Done — picking up items now disables them
Building from source
mvn clean package
The jar is output to target/DisabledItem-1.1.0.jar.
License
MIT — do whatever you want with it.
评论 0
登录后参与评分
还没有评论,来抢沙发吧