Compatibility
Minecraft: Java Edition
Platforms
Tags
Creators
Details
ServerItemManager
一款用于管制服务器物品的 Bukkit 插件:既能封禁特定材质与特定 NBT 的物品,也能自动检测并清理非法物品。
A Bukkit plugin for controlling items on your server: it can ban items by material or by exact NBT data, and it automatically detects and removes illegal items.
- 插件名 / Plugin name:
ServerItemManager - 主命令 / Main command:
/sim(完整写法/serveritemmanager) - 作者 / Author:Morpe14514
简体中文
功能特性
1. 物品管制
- 纯材质管制:管制某个材质的全部物品,无论 NBT 是否相同(如
minecraft:tnt) - 原型管制:只管制带有特定 NBT 的物品,使用
/sim addhand将手中物品连同 NBT 一起加入管制 - 单独绕过权限:每个管制项都有一条独立绕过权限,命名规则为
serveritemmanager.bypass.<物品ID>(如serveritemmanager.bypass.end_crystal),未在items.yml中填写时由插件自动生成 - 每项独立动作链:每个管制项可配置自己的
commands列表,用内置动作([CLEAN]、[LOG]、[BROADCAST]、[MESSAGE])与自定义控制台命令自由组合,替代插件原本固定的处理流程 - 全局绕过权限:
serveritemmanager.bypass可一次性绕过所有管制
2. 非法物品检测
- 超限附魔等级(阈值可配置,设为 0 可关闭该项检测)
- 数量异常(超过最大堆叠或 ≤ 0)
- 无法破坏(Unbreakable)标签
- 处理方式可选:
delete(直接删除物品)或cancel(仅取消本次操作)
3. 拦截场景
| 事件 | 说明 |
|---|---|
| 拾取物品 | 阻止玩家捡起管制/非法物品 |
| 合成物品 | 阻止合成产物为管制/非法物品 |
| 使用物品 | 阻止使用或放置管制/非法物品 |
| 背包点击 | 阻止在容器与背包中拿取、移动管制/非法物品 |
4. 违规记录
- 所有拦截记录写入
plugins/ServerItemManager/logs/violations-YYYY-MM-DD.log - 按天分文件,记录时间、类型、玩家、物品 ID、显示名与数量
- 可通过
log-enabled: false一键关闭
5. 便捷管理
- 完整子命令 + Tab 补全(支持命名空间 ID,含模组物品)
add与remove的补全列表会按已输入内容过滤,并自动剔除无效的LEGACY_*材质- 消息文本全部集中在
message.yml,支持&颜色代码
命令列表
| 命令 | 说明 | 权限 |
|---|---|---|
/sim help |
显示帮助 | serveritemmanager.command.help |
/sim reload |
重载 config.yml、message.yml、items.yml |
serveritemmanager.command.reload |
/sim info |
显示插件信息 | serveritemmanager.command.info |
/sim list |
列出当前全部管制项(纯材质 + 原型) | serveritemmanager.command.list |
/sim add <物品ID> [权限] |
添加纯材质管制,可附带单独绕过权限 | serveritemmanager.command.add |
/sim addhand [权限] |
将手中物品连同 NBT 加入管制(原型管制) | serveritemmanager.command.addhand |
/sim remove <物品ID> |
移除该物品的全部管制(纯材质 + 原型) | serveritemmanager.command.remove |
/sim removehand |
移除与手中物品精确匹配的管制项 | serveritemmanager.command.removehand |
物品 ID 使用命名空间格式,例如
minecraft:tnt、mtr:railway_sign。
权限节点
| 权限 | 说明 | 默认 |
|---|---|---|
serveritemmanager.bypass |
绕过所有管制物品检查(全局) | op |
serveritemmanager.command.help |
查看帮助 | true |
serveritemmanager.command.info |
查看插件信息 | true |
serveritemmanager.command.reload |
重载配置 | op |
serveritemmanager.command.list |
查看管制列表 | op |
serveritemmanager.command.add |
添加材质管制 | op |
serveritemmanager.command.addhand |
添加手中物品 | op |
serveritemmanager.command.remove |
移除材质管制 | op |
serveritemmanager.command.removehand |
移除手中物品对应的管制 | op |
物品级别的绕过权限不需要在 plugin.yml 中声明:插件会在启动与 /sim reload 时,把当前所有管制项的权限节点动态注册到服务端(默认值 false,需由权限插件显式授予),因此 LuckPerms 等插件可以直接识别、补全这些节点。
权限命名规则:
| 物品 | 默认绕过权限 |
|---|---|
minecraft:end_crystal |
serveritemmanager.bypass.end_crystal |
minecraft:tnt |
serveritemmanager.bypass.tnt |
mtr:railway_sign(模组物品) |
serveritemmanager.bypass.mtr.railway_sign |
| 同一材质的第 2、3 条管制 | serveritemmanager.bypass.diamond_sword.2、.3 |
想改用自定义权限名时,直接在 items.yml 的 permission 字段填写即可,插件会以配置值为准;把该行删掉则回到自动生成的默认权限。/sim list 会显示每一项实际生效的权限,/sim add、/sim addhand 的补全会给出默认权限建议。
配置文件
config.yml
controlled-item-check:
message: "&c此物品已被服务器管制,请联系管理员!"
broadcast:
message: "&e玩家 {player} 持有被管制的物品 {item} (数量: {amount}),操作已阻止!"
illegal-item-check:
enabled: true # 非法物品检测总开关
max-enchant-level: 10 # 最大附魔等级,0 表示不检测附魔
check-stack-size: true # 检测数量异常
check-unbreakable: false # 检测无法破坏标签
action: delete # delete / cancel
message: "&c检测到非法物品,已被自动清除!"
broadcast:
enabled: true
message: "&e玩家 {player} 持有非法物品 {item} (数量: {amount}),已被自动处理!"
log-enabled: true # 是否写入违规日志
controlled-item-check 段只保留文案,不再有 enabled 之类的启用开关 —— 检测到管制物品后做什么完全由 items.yml 中该管制项的 commands 决定。
items.yml
controlled-items:
minecraft:tnt: {} # 纯材质管制
minecraft:end_crystal: # 纯材质管制 + 单独绕过权限 + 自定义动作链
permission: "serveritemmanager.bypass.end_crystal"
commands:
- "[CLEAN]"
- "[LOG]"
- "[MESSAGE]"
- "[BROADCAST]"
- "say &c玩家 {player} 试图使用被管制的 {item}"
commands 是检测到该管制物品时要执行的动作列表,按书写顺序依次执行。通过 /sim add 与 /sim addhand 添加管制项时,插件会自动写入默认动作 [LOG]、[BROADCAST]、[MESSAGE]、[CLEAN],可直接在此基础上增删;手写配置不填该项时插件不做任何处理,命中管制只会取消事件,不会写日志、广播、提示或清除物品。插件不会执行任何内置固定流程,一切以这里列出的动作为准。可用的内置动作:
| 内置动作 | 说明 |
|---|---|
[LOG] |
写入违规日志(log-enabled: false 时不生效) |
[BROADCAST] |
按 config.yml 中 controlled-item-check.broadcast.message 全局广播 |
[MESSAGE] |
向触发的玩家发送 controlled-item-check.message 提示 |
[CLEAN] |
清除物品:拾取时移除掉落物、手持时清空该手、背包点击时清空该槽位;合成时无法单独清除产出,表现为阻止本次合成 |
除内置动作外的其它条目一律以控制台身份执行,不受触发玩家自身权限限制,因此可以直接写 op 级命令(如 kick、ban、lp user ...);无需写前导 /,写了也会被自动去掉。支持占位符 {player}(玩家名)、{item}(物品命名空间 ID)、{amount}(数量)。若服务端安装了 PlaceholderAPI(本插件的可选软依赖,未安装时自动跳过),命令中的 %xxx% 也会被解析,解析上下文是触发的玩家,因此 %player_name%、%server_online% 等在控制台执行时同样有效。内置动作名大小写不敏感。注意:无论是否配置 commands,命中管制时对应事件都会被取消,commands 只决定附加处理动作。
原型管制条目由 /sim addhand 自动生成,物品数据存放在 item 子节点下,与 permission 并列:
controlled-items:
minecraft:cherry_planks:
permission: "serveritemmanager.bypass.cherry_planks"
item: # 服务端原样序列化的物品数据,请勿手写
DataVersion: 5023
id: minecraft:cherry_planks
count: 1
schema_version: 1
item 中的字段由服务端序列化格式决定(1.21.5+ 起为 DataVersion、id、count、schema_version 等),插件只做原样读写、不会注入额外字段。同一材质存在多个原型时,插件会自动追加 #序号 后缀(如 minecraft:diamond_sword#2),解析时自动忽略该后缀,请勿手动维护。
message.yml
所有面向玩家与命令发送者的文本都在这里,支持 & 颜色代码,改完执行 /sim reload 即可生效。
安装
- 确认服务端为 Bukkit / Spigot / Paper 1.18 及以上(Java 17+)
- 将
ServerItemManager-x.x.x.jar放入服务端的plugins/目录 - 启动服务端,首次启动会把 bstats 依赖下载到服务端根目录的
libraries/(需要联网一次),同时在plugins/ServerItemManager/下生成默认配置 - 按需编辑配置,执行
/sim reload重载
可选:安装 PlaceholderAPI 后,items.yml 中 commands 里的 %xxx% 占位符会被自动解析。本插件把它声明为 softdepend 并通过反射调用,未安装时相关功能静默跳过,不影响启动与其他功能。
构建
mvn clean package
产物为 target/ServerItemManager-<版本>.jar。jar 本体不含任何第三方代码:bstats 在 plugin.yml 的 libraries 中声明,由服务端首次启动时下载到服务端自己的 libraries/ 目录,因此不会在插件目录下生成多余文件,也不会与其他插件冲突。
版本号只在 pom.xml 的 <version> 中维护,plugin.yml 使用 ${project.version} 由 Maven 在构建时自动替换,无需两处手改。
兼容性
- Bukkit / Spigot / Paper 1.18 ~ 1.21.x(
api-version为1.18,编译时以 1.18.2 API 为基准,不会引用更高版本才有的接口) - Folia:已声明
folia-supported: true,事件监听全部在玩家所在区域线程中执行 - 混合端(Mohist / Youer):启动时会自动识别服务端类型并输出到控制台
- 模组物品:只要服务端注册了对应材质,即可通过命名空间 ID 进行管制与补全
- 物品数据格式:
items.yml中保存的是服务端原样序列化的物品数据,插件不做改写;不同版本的字段差异由插件自动兼容,升级服务端后无需手动迁移
隐私说明
插件使用 bStats(插件 ID 30253)收集匿名的服务端类型、在线人数等统计信息,不含玩家数据。依赖通过 plugin.yml 的 libraries 声明,由服务端首次启动时下载到 libraries/ 目录;若下载失败,插件只会在控制台提示并跳过统计,不影响其他功能。可在 plugins/bStats/config.yml 中关闭。
联系方式
- 作者:Morpe14514
- 交流群:1085808257
English
Features
1. Item control
- Material control — blocks every item of a given material regardless of NBT (e.g.
minecraft:tnt) - Prototype control — blocks only items matching specific NBT data; use
/sim addhandto add the item in your hand together with its NBT - Per-item bypass permission — every controlled entry gets its own permission named
serveritemmanager.bypass.<item id>(e.g.serveritemmanager.bypass.end_crystal), generated automatically when thepermissionfield is omitted - Per-entry action chain — each controlled entry can define its own
commandslist, mixing built-in actions ([CLEAN],[LOG],[BROADCAST],[MESSAGE]) with arbitrary console commands, replacing the plugin's previously hard-coded handling - Global bypass permission —
serveritemmanager.bypassbypasses every check at once
2. Illegal item detection
- Enchantment levels above a configurable threshold (set to
0to disable this check) - Abnormal stack size (greater than max stack size, or ≤ 0)
Unbreakabletag- Action is configurable:
delete(remove the item) orcancel(only cancel the action)
3. Interception points
| Event | Behaviour |
|---|---|
| Item pickup | Prevents players from picking up controlled / illegal items |
| Crafting | Blocks results that are controlled / illegal |
| Item usage | Blocks using or placing controlled / illegal items |
| Inventory click | Blocks taking or moving controlled / illegal items in containers and inventories |
4. Violation log
- Every interception is written to
plugins/ServerItemManager/logs/violations-YYYY-MM-DD.log - One file per day, recording time, type, player, item ID, display name and amount
- Can be disabled with
log-enabled: false
5. Management convenience
- Full sub-command set with tab completion (namespace IDs supported, including modded items)
- Completion lists for
addandremoveare filtered by your current input and automatically exclude the uselessLEGACY_*materials - All user-facing texts live in
message.ymland support&colour codes
Commands
| Command | Description | Permission |
|---|---|---|
/sim help |
Show help | serveritemmanager.command.help |
/sim reload |
Reload config.yml, message.yml, items.yml |
serveritemmanager.command.reload |
/sim info |
Show plugin information | serveritemmanager.command.info |
/sim list |
List all controlled entries (material + prototype) | serveritemmanager.command.list |
/sim add <item id> [permission] |
Add a material control, optionally with a bypass permission | serveritemmanager.command.add |
/sim addhand [permission] |
Add the item in hand including its NBT (prototype control) | serveritemmanager.command.addhand |
/sim remove <item id> |
Remove all controls of that material (material + prototype) | serveritemmanager.command.remove |
/sim removehand |
Remove the entry that exactly matches the item in hand | serveritemmanager.command.removehand |
Item IDs use the namespaced format, e.g.
minecraft:tntormtr:railway_sign.
Permissions
| Permission | Description | Default |
|---|---|---|
serveritemmanager.bypass |
Bypass every controlled-item check (global) | op |
serveritemmanager.command.help |
View help | true |
serveritemmanager.command.info |
View plugin information | true |
serveritemmanager.command.reload |
Reload configuration | op |
serveritemmanager.command.list |
View the controlled list | op |
serveritemmanager.command.add |
Add material controls | op |
serveritemmanager.command.addhand |
Add the item in hand | op |
serveritemmanager.command.remove |
Remove material controls | op |
serveritemmanager.command.removehand |
Remove the control matching the item in hand | op |
Per-item bypass permissions do not need to be declared in plugin.yml: on startup and on /sim reload the plugin registers every controlled entry's permission node with the server (default value false, so it must be granted explicitly), which makes them discoverable in LuckPerms and similar plugins.
Naming rules:
| Item | Default bypass permission |
|---|---|
minecraft:end_crystal |
serveritemmanager.bypass.end_crystal |
minecraft:tnt |
serveritemmanager.bypass.tnt |
mtr:railway_sign (modded) |
serveritemmanager.bypass.mtr.railway_sign |
| 2nd, 3rd control of the same material | serveritemmanager.bypass.diamond_sword.2, .3 |
To use a custom name, simply fill in the permission field of items.yml — the configured value always wins. Remove that line to fall back to the generated default. /sim list shows the effective permission of every entry, and tab completion for /sim add and /sim addhand suggests the default permission.
Configuration
config.yml
controlled-item-check:
message: "&cThis item is controlled by the server, please contact an administrator!"
broadcast:
message: "&ePlayer {player} tried to use controlled item {item} (amount: {amount}); the action was blocked!"
illegal-item-check:
enabled: true # master switch for illegal item detection
max-enchant-level: 10 # max allowed enchantment level, 0 disables the enchantment check
check-stack-size: true # detect abnormal stack sizes
check-unbreakable: false # detect the Unbreakable tag
action: delete # delete / cancel
message: "&cAn illegal item was detected and removed automatically!"
broadcast:
enabled: true
message: "&ePlayer {player} had illegal item {item} (amount: {amount}); it was handled automatically!"
log-enabled: true # whether to write the violation log
The controlled-item-check section only holds message templates and has no enabled switch any more — what happens after a controlled item is detected is decided entirely by that entry's commands in items.yml.
items.yml
controlled-items:
minecraft:tnt: {} # material control
minecraft:end_crystal: # material control + per-item bypass permission + custom action chain
permission: "serveritemmanager.bypass.end_crystal"
commands:
- "[CLEAN]"
- "[LOG]"
- "[MESSAGE]"
- "[BROADCAST]"
- "say &cPlayer {player} tried to use controlled item {item}"
commands lists the actions to run when the controlled item is detected, executed in the written order. Entries created by /sim add and /sim addhand automatically get the default actions [LOG], [BROADCAST], [MESSAGE] and [CLEAN], which you can extend or trim; hand-written entries that omit it are left untouched — the plugin only cancels the event and does nothing else (no log, broadcast, message or removal). The plugin runs no built-in fixed flow at all; everything follows the listed actions. Available built-in actions:
| Action | Description |
|---|---|
[LOG] |
Write the violation log (skipped when log-enabled: false) |
[BROADCAST] |
Broadcast controlled-item-check.broadcast.message |
[MESSAGE] |
Send controlled-item-check.message to the triggering player |
[CLEAN] |
Remove the item: drop removal on pickup, clear the used hand, clear the clicked slot; crafting cannot remove the result, so it only blocks the craft |
Every other entry is dispatched as the console sender, so it is not limited by the triggering player's permissions and may run op-level commands (kick, ban, lp user ..., ...). A leading / is optional and stripped automatically. Placeholders: {player} (player name), {item} (item namespaced ID) and {amount} (amount). If PlaceholderAPI is installed (optional soft dependency, skipped automatically when absent), %xxx% placeholders are resolved too, using the triggering player as context, so %player_name% and %server_online% work even though the command runs from console. Built-in action names are case-insensitive. Note that the triggering event is always cancelled when a controlled item is detected — commands only controls the extra handling.
Prototype entries are generated automatically by /sim addhand and store the item data under an item node next to permission:
controlled-items:
minecraft:cherry_planks:
permission: "serveritemmanager.bypass.cherry_planks"
commands:
- "[CLEAN]"
item: # serialized by the server as-is, do not edit
DataVersion: 5023
id: minecraft:cherry_planks
count: 1
schema_version: 1
The fields inside item follow the server's own serialization format (since 1.21.5: DataVersion, id, count, schema_version, ...). The plugin reads and writes them verbatim and never injects extra fields. When several prototypes share the same material, the plugin appends a #index suffix (e.g. minecraft:diamond_sword#2); the suffix is stripped when loading, so never edit it manually.
message.yml
Every text shown to players and command senders is defined here, with & colour code support. Run /sim reload after editing.
Installation
- Make sure your server is Bukkit / Spigot / Paper 1.18 or newer (Java 17+)
- Drop
ServerItemManager-x.x.x.jarinto the server'splugins/folder - Start the server; on first startup the bStats library is downloaded into the server's
libraries/folder (needs internet access once) and default configuration files are generated underplugins/ServerItemManager/ - Edit the configuration as needed and run
/sim reload
Optional: with PlaceholderAPI installed, %xxx% placeholders inside items.yml commands are resolved automatically. It is declared as a softdepend and invoked via reflection, so when absent the feature is silently skipped and nothing else is affected.
Building
mvn clean package
The output is target/ServerItemManager-<version>.jar. The jar itself contains no third-party code: bStats is declared in plugin.yml under libraries, so the server downloads it into the server's own libraries/ folder on first startup.
The version number is maintained only in pom.xml; plugin.yml uses ${project.version}, which Maven replaces automatically during the build.
Compatibility
- Bukkit / Spigot / Paper 1.18 – 1.21.x (
api-versionis1.18and the project compiles against the 1.18.2 API, so no API newer than 1.18 can slip in) - Folia:
folia-supported: trueis declared; all listeners run on the region thread that owns the player - Hybrid servers (Mohist / Youer): the server type is detected on startup and printed to the console
- Modded items: as long as the material is registered on the server, it can be controlled and completed by its namespace ID
- Item data format:
items.ymlstores item data exactly as the server serialized it and the plugin never rewrites it; version differences are handled automatically, so no manual migration is needed after a server upgrade
Privacy
The plugin uses bStats (plugin ID 30253), which only reports anonymous statistics such as server type and player count — no player data. The dependency is declared in plugin.yml under libraries and downloaded by the server into libraries/ on first startup; if the download fails, the plugin logs a warning and simply skips statistics. You can disable it in plugins/bStats/config.yml.
Contact
- Author: Morpe14514
- Community group (QQ): 1085808257


