RestrictionsPlugin
适用于 Paper 1.21.11 服务器的全面且完全可配置的限制系统。
禁止物品、限制堆叠大小、上限耐久度、禁用附魔、控制合成与掉落——所有功能均可通过游戏内 GUI 或命令实现,无需重启服务器。
✦ 特性
全局机制限制
可单独切换的规则,针对 SMP 服务器上已知会导致平衡性或漏洞问题的特定原版机制:
| 限制项 |
作用 |
| 不死图腾 |
不死图腾不会在任何地方掉落。如果玩家以某种方式获得它,它会立即从背包中被移除。 |
| 末影水晶 & 重生锚 |
无法合成、拾取、放置或通过漏斗移动。现有的重生锚在被破坏时不掉落任何物品。 |
| 重锤 |
无法获得或合成。不造成伤害。 |
| 鞘翅 |
无法拾取、穿戴或用于滑翔。 |
| 药水 |
禁止力量 II、速度 II、海龟大师 I & II 的所有形式(常规、喷溅、滞留)。酿造被阻止。 |
| TNT 矿车 |
每个区块最多 2 个。无法由火、火焰附魔箭、火球、岩浆或其他任何燃烧源点燃。 |
| TNT 复制器修复 |
活塞无法推或拉 TNT 方块,消除了最常见的复制漏洞。 |
| 经验修补交易 |
普通村民不能提供或学习经验修补书的交易。打开 GUI 时会移除现有的交易。 |
| 禁用的附魔 |
裂隙、密度和击退 II 在全局范围内从所有物品中移除。 |
| 三叉戟 |
耐久度上限为 100。无法获得经验修补。 |
| 铁傀儡农场 |
村庄生成的铁傀儡被完全阻止。手动建造的傀儡(4 个铁块 + 雕刻南瓜)不受影响。 |
单项物品限制系统
每个 Minecraft 物品都可以单独配置以下任意组合:
- ? 禁止 — 完全从背包中移除,防止拾取、合成、放置和掉落
- ? 最大堆叠数 — 将堆叠上限设为 1 到 64 之间的任意值
- ⚒️ 最大耐久度 — 限制剩余耐久度(例如,将剑的使用次数限制为 100 次)
- ? 禁止在合成中使用 — 阻止作为合成材料或结果
- ? 禁止放置 — 防止作为方块放置
- ?️ 禁止掉落 — 阻止 Q 键掉落和死亡掉落
- ✨ 单项附魔禁止 — 仅从特定物品中移除特定附魔
- ?️ 强制显示名称 — 使用颜色代码支持覆盖物品名称
- ? 强制背景故事 — 向该物品的所有实例注入自定义背景故事行
所有更改都保存到 items.yml 并立即生效,无需重启服务器。
游戏内 GUI
输入 /itemgui 打开——无需记忆命令。
物品浏览器 — 分页列出所有 Minecraft 物品,配置过的物品优先显示,带有绿色附魔光泽和工具提示中的规则摘要。
物品编辑器 — 点击任何物品以打开其完整编辑器:
- 禁止、禁止合成、禁止放置、禁止掉落的切换开关
- 左/右键点击提高或降低最大堆叠数和最大耐久度;Shift 用于 ×10 步长;中键重置
- 附魔禁止预览,带有关闭按钮
- 通过聊天输入强制编辑名称和背景故事
附魔选择器 — 分页列出所有约 40 种附魔。点击以禁止或取消禁止特定物品的附魔。绿色 = 当前已禁止,灰色 = 允许。
? 要求
- Paper 1.21.11(或任何 1.21.x 版本)
- Java 17+
- 无依赖项
⚙️ 安装
- 下载
RestrictionsPlugin
- 将其放入服务器的
plugins/ 文件夹中
- 启动或重启服务器
- 会自动创建两个配置文件:
plugins/RestrictionsPlugin/config.yml — 全局限制切换
plugins/RestrictionsPlugin/items.yml — 单项物品规则
? 权限
| 权限 |
默认值 |
描述 |
restrictions.admin |
OP |
访问所有命令和 GUI |
? 命令
/restrict — 全局机制切换
需要 restrictions.admin
| 命令 |
描述 |
/restrict |
显示所有限制及其当前的开/关状态 |
/restrict list |
同上 |
/restrict toggle <key> |
切换限制的开启或关闭 |
/restrict enable <key> |
启用限制 |
/restrict disable <key> |
禁用限制 |
/restrict enableall |
一次性启用所有限制 |
/restrict disableall |
一次性禁用所有限制 |
/restrict reload |
从磁盘重新加载 config.yml |
可用键:
| 键 |
限制 |
totem |
不死图腾 |
crystal_anchor |
末影水晶 & 重生锚 |
mace |
重锤 |
elytra |
鞘翅 |
potions |
力量 II / 速度 II / 海龟大师药水 |
tnt_minecart |
TNT 矿车区块限制及防火免疫 |
tnt_duper |
TNT 复制器修复(活塞 + TNT) |
mending_trade |
经验修补村民交易 |
enchantments |
裂隙、密度、击退 II 全局禁止 |
trident |
三叉戟耐久度上限及无经验修补 |
iron_farm |
自动铁傀儡农场预防 |
示例:
/restrict toggle elytra
/restrict disable tnt_minecart
/restrict enable totem
/restrict disableall
/itemgui — 物品限制 GUI
需要 restrictions.admin · 仅限玩家
打开完整的游戏内 GUI 以浏览和编辑单项物品限制。
/itemgui
使用 GUI 可视化配置任何物品。所有更改自动保存。
/itemrestrict — 单项物品限制(命令界面)
需要 restrictions.admin
所有命令均支持将 hand 作为物品参数——目标是你当前手持的物品。
/itemrestrict list
显示至少有一个活跃规则的所有物品,以及每项的摘要。
/itemrestrict info <item|hand>
显示特定物品配置的每条规则的详细分解。
/itemrestrict info DIAMOND_SWORD
/itemrestrict info hand
/itemrestrict set <item|hand> banned <true|false>
完全禁止某物品。玩家获得该物品后,它会被静默移除。
/itemrestrict set ENCHANTED_GOLDEN_APPLE banned true
/itemrestrict set hand banned true
/itemrestrict set <item|hand> max_stack <1-64>
设置最大堆叠数量。使用 -1 可重置为原版默认值。
/itemrestrict set GOLDEN_APPLE max_stack 16
/itemrestrict set TNT max_stack 8
/itemrestrict set GOLDEN_APPLE max_stack -1
/itemrestrict set <item|hand> max_durability <number>
限制物品的最大剩余耐久度。使用 -1 可重置。
/itemrestrict set DIAMOND_SWORD max_durability 500
/itemrestrict set hand max_durability 100
/itemrestrict set DIAMOND_SWORD max_durability -1
/itemrestrict set <item|hand> banned_in_crafting <true|false>
防止该物品作为合成材料或被用作合成结果。
/itemrestrict set TNT banned_in_crafting true
/itemrestrict set <item|hand> banned_placing <true|false>
防止该物品被放置为方块。
/itemrestrict set RESPAWN_ANCHOR banned_placing true
/itemrestrict set <item|hand> banned_dropping <true|false>
防止该物品通过按 Q 键掉落,也不出现在死亡掉落物中。
/itemrestrict set NETHERITE_INGOT banned_dropping true
/itemrestrict set <item|hand> banned_enchants add <enchant>
禁止特定物品附魔特定附魔。只要该物品在玩家的背包中,其附魔就会被移除。
/itemrestrict set DIAMOND_SWORD banned_enchants add sharpness
/itemrestrict set BOW banned_enchants add power
/itemrestrict set <item|hand> banned_enchants remove <enchant>
移除对特定物品的特定附魔禁令。
/itemrestrict set DIAMOND_SWORD banned_enchants remove sharpness
/itemrestrict set <item|hand> banned_enchants clear
移除针对某物品的所有附魔禁令。
/itemrestrict set DIAMOND_SWORD banned_enchants clear
/itemrestrict set <item|hand> force_name <name>
强制所有此类物品显示指定名称。使用 & 表示颜色代码。使用 clear 可清除。
/itemrestrict set GOLDEN_SWORD force_name &6&lThe Golden Blade
/itemrestrict set GOLDEN_SWORD force_name clear
/itemrestrict set <item|hand> force_lore add <text>
向物品添加固定的描述文本行。使用 & 表示颜色代码。各行按顺序追加。
/itemrestrict set DIAMOND_SWORD force_lore add &7Server restricted item
/itemrestrict set DIAMOND_SWORD force_lore add &cHandle with care
/itemrestrict set <item|hand> force_lore remove <index>
通过索引(从 0 开始)移除特定的描述文本行。
/itemrestrict set DIAMOND_SWORD force_lore remove 0
/itemrestrict set <item|hand> force_lore clear
移除物品上的所有固定描述文本行。
/itemrestrict set DIAMOND_SWORD force_lore clear
/itemrestrict clear <item|hand>
移除针对某物品的所有规则配置,使其恢复为完全不受限状态。
/itemrestrict clear DIAMOND_SWORD
/itemrestrict clear hand
/itemrestrict reload
从磁盘重新加载 items.yml。如果您手动编辑过该文件,此命令非常有用。
/itemrestrict reload
? 配置文件
config.yml
控制全局机制限制。所有值的默认均为 true(启用)。
restrictions:
totem: true
crystal_anchor: true
mace: true
elytra: true
potions: true
tnt_minecart: true
tnt_duper: true
mending_trade: true
enchantments: true
trident: true
iron_farm: true
items.yml
针对单个物品的规则。可手动编辑,也可在游戏中使用 /itemrestrict 和 /itemgui 命令进行设置。
items:
ENCHANTED_GOLDEN_APPLE:
banned: true
GOLDEN_APPLE:
max_stack: 16
banned_in_crafting: false
DIAMOND_SWORD:
max_stack: 1
max_durability: 500
banned_enchants:
- sharpness
- fire_aspect
force_name: "&b&lDiamond Sword"
force_lore:
- "&7Server restricted item"
TNT:
banned_placing: false
banned_in_crafting: true
max_stack: 16
? 说明
- 所有
/itemrestrict 和 /itemgui 的更改都会自动保存至 items.yml 并立即生效,无需重启服务器。
- 当有待保存的更改时,
items.yml 会在后台每 30 秒写入一次磁盘,以避免频繁的磁盘 I/O 操作。
/itemrestrict 中的 hand 快捷方式指的是执行命令时玩家手中所持的物品。
- 附魔名称使用 Minecraft 的内部键名(全小写且含下划线),例如
sharpness、fire_aspect、swift_sneak。
- 颜色代码使用
& 前缀:&a = 绿色,&c = 红色,&l = 加粗,等等。
- 铁傀儡农场限制仅阻止村民机制生成的铁傀儡。玩家仍可使用 4 个铁块和 1 个雕刻南瓜手动建造铁傀儡。
RestrictionsPlugin
A comprehensive, fully configurable restriction system for Paper 1.21.11 servers.
Ban items, limit stack sizes, cap durability, block enchants, control crafting and dropping — all from an in-game GUI or via commands, with no restart required.
✦ Features
Global Mechanic Restrictions
Individually toggleable rules that target specific vanilla mechanics known to cause balance or exploit issues on SMP servers:
| Restriction |
What it does |
| Totem of Undying |
Totems never drop anywhere. If a player somehow obtains one it is immediately removed from their inventory. |
| End Crystal & Respawn Anchor |
Cannot be crafted, picked up, placed, or moved through hoppers. Existing anchors drop nothing when broken. |
| Mace |
Cannot be obtained or crafted. Does no damage. |
| Elytra |
Cannot be picked up, worn, or used to glide. |
| Potions |
Bans Strength II, Speed II, Turtle Master I & II in all forms (regular, splash, lingering). Brewing is blocked. |
| TNT Minecart |
Maximum 2 per chunk. Cannot be ignited by fire, flame enchanted arrows, fire charges, lava, or any other combustion source. |
| TNT Duper Fix |
Pistons cannot push or pull TNT blocks, eliminating the most common duplication exploits. |
| Mending Trades |
Regular villagers cannot offer or learn Mending book trades. Existing trades are stripped on GUI open. |
| Banned Enchantments |
Breach, Density, and Punch II are stripped from all items globally. |
| Trident |
Capped at 100 durability. Cannot receive Mending. |
| Iron Farm |
Village-spawned Iron Golems are completely blocked. Manually built golems (4 iron blocks + carved pumpkin) are unaffected. |
Per-Item Restriction System
Every single Minecraft item can be individually configured with any combination of:
- ? Banned — completely removes from inventory, prevents pickup, crafting, placing, and dropping
- ? Max Stack Size — cap stacks at any value from 1 to 64
- ⚒️ Max Durability — cap remaining durability (e.g. limit a sword to 100 uses)
- ? Banned in Crafting — block as crafting ingredient or result
- ? Banned Placing — prevent placing as a block
- ?️ Banned Dropping — block Q-key drops and death drops
- ✨ Per-item Enchant Bans — strip specific enchantments from a specific item only
- ?️ Force Display Name — override the item name with color code support
- ? Force Lore — inject custom lore lines onto all instances of the item
All changes are saved to items.yml and take effect immediately without a server restart.
In-Game GUI
Open with /itemgui — no commands to memorize.
Item Browser — paginated list of all Minecraft items, configured items shown first with a green enchant glow and a rule summary in the tooltip.
Item Editor — click any item to open its full editor:
- Toggle switches for banned, no-crafting, no-placing, no-dropping
- Left/right-click to raise or lower max stack and max durability; shift for ×10 steps; middle-click to reset
- Enchant ban preview with click-to-remove buttons
- Force name and lore editing via in-chat input
Enchant Picker — paginated list of all ~40 enchantments. Click to ban or unban for the specific item. Green = currently banned, grey = allowed.
? Requirements
- Paper 1.21.11 (or any 1.21.x build)
- Java 17+
- No dependencies
⚙️ Installation
- Download
RestrictionsPlugin
- Place it in your server's
plugins/ folder
- Start or restart the server
- Two config files are created automatically:
plugins/RestrictionsPlugin/config.yml — global restriction toggles
plugins/RestrictionsPlugin/items.yml — per-item rules
? Permissions
| Permission |
Default |
Description |
restrictions.admin |
OP |
Access to all commands and the GUI |
? Commands
/restrict — Global Mechanic Toggles
Requires restrictions.admin
| Command |
Description |
/restrict |
Show all restrictions with their current on/off status |
/restrict list |
Same as above |
/restrict toggle <key> |
Toggle a restriction on or off |
/restrict enable <key> |
Enable a restriction |
/restrict disable <key> |
Disable a restriction |
/restrict enableall |
Enable every restriction at once |
/restrict disableall |
Disable every restriction at once |
/restrict reload |
Reload config.yml from disk |
Available keys:
| Key |
Restriction |
totem |
Totem of Undying |
crystal_anchor |
End Crystal & Respawn Anchor |
mace |
Mace |
elytra |
Elytra |
potions |
Strength II / Speed II / Turtle Master potions |
tnt_minecart |
TNT Minecart chunk limit & fire immunity |
tnt_duper |
TNT Duper Fix (piston + TNT) |
mending_trade |
Mending villager trades |
enchantments |
Breach, Density, Punch II global ban |
trident |
Trident durability cap & no Mending |
iron_farm |
Automatic Iron Golem farm prevention |
Examples:
/restrict toggle elytra
/restrict disable tnt_minecart
/restrict enable totem
/restrict disableall
/itemgui — Item Restriction GUI
Requires restrictions.admin · Player only
Opens the full in-game GUI for browsing and editing per-item restrictions.
/itemgui
Use the GUI to configure any item visually. All changes save automatically.
/itemrestrict — Per-Item Restrictions (Command Interface)
Requires restrictions.admin
All commands support hand as the item argument — targets whatever you are currently holding.
/itemrestrict list
Show all items that have at least one active rule, with a summary of each.
/itemrestrict info <item|hand>
Show a detailed breakdown of every rule configured for a specific item.
/itemrestrict info DIAMOND_SWORD
/itemrestrict info hand
/itemrestrict set <item|hand> banned <true|false>
Completely ban an item. Players who obtain it will have it silently removed.
/itemrestrict set ENCHANTED_GOLDEN_APPLE banned true
/itemrestrict set hand banned true
/itemrestrict set <item|hand> max_stack <1-64>
Set the maximum stack size. Use -1 to reset to vanilla default.
/itemrestrict set GOLDEN_APPLE max_stack 16
/itemrestrict set TNT max_stack 8
/itemrestrict set GOLDEN_APPLE max_stack -1
/itemrestrict set <item|hand> max_durability <number>
Cap the maximum remaining durability of an item. Use -1 to reset.
/itemrestrict set DIAMOND_SWORD max_durability 500
/itemrestrict set hand max_durability 100
/itemrestrict set DIAMOND_SWORD max_durability -1
/itemrestrict set <item|hand> banned_in_crafting <true|false>
Prevent the item from being used as a crafting ingredient or appearing as a crafting result.
/itemrestrict set TNT banned_in_crafting true
/itemrestrict set <item|hand> banned_placing <true|false>
Prevent the item from being placed as a block.
/itemrestrict set RESPAWN_ANCHOR banned_placing true
/itemrestrict set <item|hand> banned_dropping <true|false>
Prevent the item from being dropped with Q and from appearing in death drops.
/itemrestrict set NETHERITE_INGOT banned_dropping true
/itemrestrict set <item|hand> banned_enchants add <enchant>
Ban a specific enchantment from a specific item. The enchantment will be stripped whenever the item is in a player's inventory.
/itemrestrict set DIAMOND_SWORD banned_enchants add sharpness
/itemrestrict set BOW banned_enchants add power
/itemrestrict set <item|hand> banned_enchants remove <enchant>
Remove a specific enchantment ban from an item.
/itemrestrict set DIAMOND_SWORD banned_enchants remove sharpness
/itemrestrict set <item|hand> banned_enchants clear
Remove all enchantment bans for an item.
/itemrestrict set DIAMOND_SWORD banned_enchants clear
/itemrestrict set <item|hand> force_name <name>
Force a display name on all instances of this item. Use & for color codes. Use clear to remove.
/itemrestrict set GOLDEN_SWORD force_name &6&lThe Golden Blade
/itemrestrict set GOLDEN_SWORD force_name clear
/itemrestrict set <item|hand> force_lore add <text>
Add a forced lore line to an item. Use & for color codes. Lines are appended in order.
/itemrestrict set DIAMOND_SWORD force_lore add &7Server restricted item
/itemrestrict set DIAMOND_SWORD force_lore add &cHandle with care
/itemrestrict set <item|hand> force_lore remove <index>
Remove a specific lore line by its index (0-based).
/itemrestrict set DIAMOND_SWORD force_lore remove 0
/itemrestrict set <item|hand> force_lore clear
Remove all forced lore lines from an item.
/itemrestrict set DIAMOND_SWORD force_lore clear
/itemrestrict clear <item|hand>
Remove every rule configured for an item, restoring it to completely unrestricted.
/itemrestrict clear DIAMOND_SWORD
/itemrestrict clear hand
/itemrestrict reload
Reload items.yml from disk. Useful if you edited the file manually.
/itemrestrict reload
? Configuration Files
config.yml
Controls the global mechanic restrictions. All values default to true (enabled).
restrictions:
totem: true
crystal_anchor: true
mace: true
elytra: true
potions: true
tnt_minecart: true
tnt_duper: true
mending_trade: true
enchantments: true
trident: true
iron_farm: true
items.yml
Per-item rules. Edit manually or use /itemrestrict and /itemgui in-game.
items:
ENCHANTED_GOLDEN_APPLE:
banned: true
GOLDEN_APPLE:
max_stack: 16
banned_in_crafting: false
DIAMOND_SWORD:
max_stack: 1
max_durability: 500
banned_enchants:
- sharpness
- fire_aspect
force_name: "&b&lDiamond Sword"
force_lore:
- "&7Server restricted item"
TNT:
banned_placing: false
banned_in_crafting: true
max_stack: 16
? Notes
- All
/itemrestrict and /itemgui changes save automatically to items.yml and take effect immediately without a restart.
items.yml is written to disk in the background every 30 seconds when changes are pending, to avoid per-click disk I/O.
- The
hand shortcut in /itemrestrict targets the item you are holding at the time of the command.
- Enchantment names use Minecraft's internal keys (lowercase with underscores), e.g.
sharpness, fire_aspect, swift_sneak.
- Color codes use the
& prefix: &a = green, &c = red, &l = bold, etc.
- The iron farm restriction only blocks village-mechanic spawns. Players can still build golems manually with 4 iron blocks and a carved pumpkin.
评论 0
登录后参与评分
还没有评论,来抢沙发吧