ItemLimiter 插件
概述
此插件在 Paper 服务器上为每个物品强制执行玩家库存上限。它确保玩家无法超过特定原版材料(vanilla materials)定义的最大数量,无论物品是如何获得或移动的。该系统会实时主动检查和控制物品流动,而不仅仅是在事后进行修正。
核心功能
- 针对每种原版 Material(例如 DIAMOND、TNT、ENDER_PEARL)执行限制
- 在所有主要的物品获取和转移方式中应用限制
- 防止玩家超出配置的物品上限
支持的交互场景
该插件监控并限制以下场景中的物品:
- 地面拾取
- 防止玩家拾取超过其允许上限的物品
- 超出部分保留在地面上
- 箱子 / 库存 GUI
- 阻止或减少从箱子、 barrels(木桶)、shulkers(潜影盒)等容器中转移物品
- 超出部分保留在容器内
- 快捷切换 / 数字键 / 拖拽
- 处理 GUI 内的所有库存移动方法
- 无论采用何种转移方式,均确保执行限制
- 合成输出
- 如果合成输出会导致玩家超出限制,则减少合成产出量
- 如果没有可用空间,则完全禁止合成
- 漏斗传输
- 登录安全检查
限制行为
- 部分允许模式(Partial Allow Mode):
如果玩家会超出限制,仅转移允许的数量的物品。
剩余部分留在原始来源处(地面、箱子或合成输出)。
限制:16 钻石
玩家拥有:14 钻石
incoming:8 钻石
结果:玩家获得 2 钻石,剩余的 6 个保留在来源处
权限
- itemlimiter.bypass
允许管理员忽略所有限制
配置 (config.yml)
示例:
limits:
DIAMOND: 16
ENDER_PEARL: 8
TNT: 32
实现说明
- 使用 Paper 事件系统(InventoryClickEvent、EntityPickupItemEvent、InventoryDragEvent 等)
- 仅设计用于原版材料(vanilla materials)
- 跨多种交互路径持续执行限制
- 通过在多个事件中保持一致的库存验证,防止大多数重复生成(duplication)
ItemLimiter Plugin
Overview
This plugin enforces per-item inventory limits for players on a Paper server. It ensures players cannot exceed defined maximum amounts for specific vanilla materials, regardless of how items are obtained or moved. The system actively checks and controls item flow in real time rather than only correcting after the fact.
Core Features
- Enforces limits per vanilla Material (e.g., DIAMOND, TNT, ENDER_PEARL)
- Applies limits across all major item acquisition and transfer methods
- Prevents players from exceeding configured item caps
Supported Interactions
The plugin monitors and limits items in the following scenarios:
- Ground Pickup
- Prevents players from picking up items beyond their allowed limit
- Excess remains on the ground
- Chest / Inventory GUIs
- Blocks or reduces item transfers from chests, barrels, shulkers, etc.
- Excess remains in the container
- Shift-Click / Number Keys / Dragging
- Handles all inventory movement methods inside GUIs
- Ensures limits are enforced regardless of transfer method
- Crafting Output
- Reduces crafted output if it would exceed the player’s limit
- Prevents crafting entirely if no space is available
- Hopper Transfers
- Limits items being inserted into player inventories via hoppers
- Login Safety Check
- Scans and corrects inventory on player join to enforce limits
Limit Behavior
- Partial Allow Mode:
If a player would exceed the limit, only the allowed amount is transferred.
The remainder is left in the original source (ground, chest, or crafting output).
Limit: 16 diamonds
Player has: 14 diamonds
Incoming: 8 diamonds
Result: Player receives 2 diamonds, remaining 6 stay in source
Permissions
- itemlimiter.bypass
Allows admins to ignore all item limits
Configuration (config.yml)
EXAMPLE:
limits:
DIAMOND: 16
ENDER_PEARL: 8
TNT: 32
Implementation Notes
- Uses Paper event system (InventoryClickEvent, EntityPickupItemEvent, InventoryDragEvent, etc.)
- Designed for vanilla materials only
- Continuously enforces limits across multiple interaction paths
- Prevents most duplication via consistent inventory validation across events
评论 0
登录后参与评分
还没有评论,来抢沙发吧