使用场景
本插件适用于拥有有限初始物品清单或禁用特定物品的生存多人游戏(SMP)服务器。例如,一个不允许玩家持有不死图腾的服务器只需在配置中将限制设置为 0;或者一个将保护类附魔等级限制为 3 级的服务器也可以进行同样的设置。服务器还可以将某物品或附魔的限制设置为 0,从而彻底禁止该物品或附魔。
工作原理
本插件通过持续检查每位玩家的背包中是否存在违规物品来运作,同时会在玩家关闭 GUI、重新登录等时机进行检查。如果插件发现玩家持有的某种物品数量超标,它会将多余的部分掉落至地面。如果发现附魔等级过高,插件会自动将该附魔等级降低至服务器设定的最大允许值。
配置文件
在 ItemCap 文件夹内,有一个简单的 config.yml 文件,允许你更改插件的设置。其内容如下:
items:
TOTEM_OF_UNDYING: 1
enchantments:
SHARPNESS: 4
在此示例中,玩家一次只能携带 1 个不死图腾,且他们的剑和斧不能附魔高于锋利 IV 的任何其他附魔。要添加受限物品或附魔,只需在你希望添加限制的栏目下新建一行,然后以大写字母输入物品或附魔的名称,并在同一行末尾以与示例相同的格式指定最大数量。
Use Cases
This plugin is useful for SMPs or other servers with a limited kit or item bans. For example, a server that doesn't allow totems of undying could simply set their limit to 0 in config, or a server that limits protection to level 3 can do the same. A server could also set an item or enchantment limit to 0 to ban that item or enchantment.
How it Works
This plugin works by consistently checking every player's inventory for illegal items, along with checking every time the player closes a GUI, relogs, etc. If the plugin finds that the player has too many of item, it will drop the extras on the ground. If the plugin finds that an enchantment level is too high, it will automatically reduce the level of the enchantment to the maximum set by the server.
Config
Inside of the ItemCap folder, there is a simple config.yml file that allows you to change the settings of the plugin. It looks like this:
items:
TOTEM_OF_UNDYING: 1
enchantments:
SHARPNESS: 4
In this example, players are only allowed to carry 1 totem of undying at a time, and their swords and axes cannot be enchanted with anything higher than sharpness 4. To add limited items or enchantments, just make a new line under the section in which you want to add a limit and type the name of the item or enchantment in all capital letters along witht the maximum number in the same format as seen in the example.
评论 0
登录后参与评分
还没有评论,来抢沙发吧