Illegal Easy Moh
这是一个用于服务器的模组,旨在限制用户与不同物品的交互方式。该模组允许标记物品,使其无法被携带、使用或对其使用施加限制。
通过此模组,管理员可以将通常写在 Discord 服务器频道内的规则转移到游戏内领域,并将其作为物品工具提示的一部分。你不仅可以显示物品属于哪个特定的“非法性”类别,并为每个物品添加自定义消息,还可以防止用户装备或携带这些物品。
功能
- 提供一个注册表,你可以在其中注册物品或整个命名空间,并为其分配一个非法性类别
- BANNED(禁止)
- ILLEGAL(非法)
- RESTRICTED(受限)
- 防止用户的背包中出现 BANNED(禁止)类物品,可以通过自动销毁或将它们丢弃在地上来实现
- 防止用户装备或在手中持有 ILLEGAL(非法)类物品
- 自定义已注册物品,使其通过工具提示向用户解释为何如此配置的原因
- 支持通过 JSON 配置文件或命令行命令进行配置
- 提供英文和西班牙文翻译
工作原理
配置模组
基本配置
你会在 world/serverconfig 文件夹中找到一个名为 _illegaleasymoh-config.json 的配置文件,它包含以下属性:
- overrideBannedCategoryName:允许你更改“禁止物品”类别的标题
- overrideIllegalCategoryName: 允许你更改“非法物品”类别的标题
- overrideRestrictedCategoryName: 允许你更改“受限物品”类别的标题
- destroyBannedItemsOnPickup:布尔值,用于确定拾取时是否销毁禁止物品(true)还是将其丢弃到地面(false)
- preventIllegalItemsUsage:布尔值,用于确定是否在装备或将物品放入手中时丢弃非法物品(true),或者是否允许保留在背包中(false)
此外,你还会在 /config 文件夹中找到一个名为 _illegaleasymoh-common.toml_ 的文件,其中包含单个配置属性:
POLLING_INTERVAL:此配置决定了客户端查询服务器以检查给定物品的注册表是否发生更改的时间间隔(单位为毫秒)。例如,
如果你将鼠标悬停在某个物品上,模组将根据 POLLING_INTERVAL 毫秒的频率查询服务器,以检查是否有任何更改。默认值为 1000ms,最小值为 100ms,最大值为 2000ms。
大多数情况下无需更改此选项,但如果出于某些原因你需要频繁变动的物品类别,你可以降低此值。
黑名单物品
使用 JSON 配置文件:
运行一次服务器后,你会在 world/serverconfig 文件夹中找到一个名为 _iem-blacklist.json 的配置文件。该文件必须包含一个具有以下结构对象数组:
{
"namespace": "minecraft",
"path": "diamond\_axe",
"category": {
"category": "2",
"message": "You can only carry 1 diamond axe"
}
}
命名空间和路径代表游戏内物品的标识符。命名空间通常与物品所属的模组相关,而路径则是物品本身的名称。例如:_ "minecraft:diamond_axe"_ 对应原版游戏中钻石斧的游戏内标识符。在这种情况下,命名空间为 "minecraft",路径为 "diamond_axe"。
如果你想将整个命名空间加入黑名单,可以使用 * 作为路径,例如:
"namespace": "securitycraft",
"path": "\*",
此配置会将整个 securitycraft 命名空间加入黑名单。
category 对象包含两个属性:类别本身(用数字表示):
- 0 代表禁止物品
- 1 代表非法物品
- 2 代表受限物品
message 属性是显示在物品工具提示下半部分的文本,它是可选的。如果你不想显示任何类型的消息,只需使用 "" 作为消息内容。
通过游戏内指令(仅限操作员)。
有 3 个供操作员使用的指令,均以 /iem 开头:
- /iem add <item> <category as a number> <message as a string surrounded by "">
- /iem remove <item>
- /iem edit <item> <category as a number> <message as a string surrounded by "">
这些指令将使更改持久化到 JSON 配置文件中,并在服务器重启后保存。
依赖要求
此模组需要安装 Curios 才能正常工作,且需要在客户端和服务端都安装。
未来版本路线图
- 允许管理员将特定附魔加入黑名单,并自动从物品上移除它们,但允许用户保留该物品
- 允许管理员禁用特定层级的元素
- 允许对物品名称配置使用通配符,例如 "*_pickaxe" 将禁用所有以 _pickaxe 结尾的物品
- 允许为用户白名单指定注册表条目
截图示例
禁止物品的外观
非法物品的外观
通过命令行向注册表添加物品
Illegal Easy Moh
This is a mod for servers that are looking to restrict how users interact with different items. The mod allows marking items a
so they are not allowed to be carried, used, or have restrictions on usage.
With this mod, admins can move the rules that are often written inside the discord server's channels inside the game domain
and be a part of the item's tooltip. Not only can you display if an item falls into a specific "Illegality" category and add custom messages to each item, but you can also prevent users from equipping or carrying them.
Features
- Provides a registry where you can register items and or complete namespaces and assign them an illegality category
- Registered items can fall into the following categories:
- BANNED
- ILLEGAL
- RESTRICTED
- Prevent users from having BANNED items on their inventories, either by destroying them or throwing them on the ground automatically
- Prevent users from equipping or having ILLEGAL items on their hands
- Customize registered items so they can have a message that explains to the users why the item is configured as it is via tooltips
- Configure through JSON configuration files or by using command line commands
- English and Spanish translations
How it works
Configuring the mod
Basic configuration
You will find a configuration file inside "world/serverconfig" called illegaleasymoh-config.json which contains the following properties:
- overrideBannedCategoryName: This allows you to change the title of the "Banned items" category
- overrideIllegalCategoryName: This allows you to change the title of the "Illegal items" category
- overrideRestrictedCategoryName: This allows you to change the title of the "Restricted items" category
- destroyBannedItemsOnPickup: Boolean value to determine if banned items are destroyed on pickup (true) or dropped to the ground (false)
- preventIllegalItemsUsage: Boolean value to determine if illegal items are dropped on equipping or placed on hand (true) or if they can be kept on the inventory (false)
You will also find a file called illegaleasymoh-common.toml inside /config folder with a single configuration property:
POLLING_INTERVAL: This configuration determines the time (in MS) on which the client will query the server to determine if there was a change on the registry for a given item if required to query. For example,
if you keep your mouse over a given item the mod will query the server every POLLING_INTERVAL milliseonds to check if any change was made. Default value is 1000ms, min value is 100ms and max value is 2000ms.
There's no need to change this option in most cases but if for some reason you have a use case that requires items that move from category constantly you may want to lower this value.
Blacklisted items
Using JSON configuration files:
Run the server once and you'll find a configuration file inside "world/serverconfig" called iem-blacklist.json. The file must contain an array of objects with the following structure
{
"namespace": "minecraft",
"path": "diamond\_axe",
"category": {
"category": "2",
"message": "You can only carry 1 diamond axe"
}
}
Namespace and path represent the item identifier inside the game. The namespace is usually related to the mod the item belongs and tto he path the name of the item itself. For example: "minecraft:diamond_axe" corresponds to the in-game identifier of the base game diamond axe. I this case the namespace would be "minecraft" and the path would be "diamond_axe"
If you wish to blacklist an entire namespace, you can use * as the path, for example:
"namespace": "securitycraft",
"path": "\*",
That configuration will blacklist the entire securitycraft namespace
The category object contains 2 properties, the category itself which is represented by a number where:
- 0 Represents banned items
- 1 Represents Illegal items
- 2 Represents restricted items
The message property is the text that would be displayed on the lower part of the item's tooltip and it's optional. If you don't wish to present any type of message just use "" as the message.
Through in-game commands for operators.
There are 3 commands for operators, all prefixed by /iem
- /iem add <item> <category as a number> <message as a string surrounded by "">
- /iem remove <item>
- /iem edit <item> <category as a number> <message as a string surrounded by "">
These commands will make the changes persistent in the JSON configuration file and will be saved If the server restarts
Requirements
This mod requires Curios in order to work, and needs to be installed both on the client and the server side.
Roadmap for future versions
- Allow admins to blacklist specific enchantments and automatically remove them from items but allow users to keep the item
- Allow admins to ban specific tiers of elements
- Allow wildcards for item names configurations, for example, "*_pickaxe" Will ban every item whose name finishes with _pickaxe
- Allow whitelisting users for a specific registry entry
Some screenshots
How banned items look
How illegal items look
Adding items to the registry through the command line
评论 0
登录后参与评分
还没有评论,来抢沙发吧